i am implementing scroll view in cocos2d-js3.1 using ccui.ScrollView class.
my code is working well on the ios simulator but if i run the same code on web browser, it doesn’t
work. browser just show the button and images used in scroll view. but i can’ t scroll on them
here 's my code :-
var UIScrollViewTest_Vertical = cc.Layer.extend({
ctor: function () {
this._super();
var winSize = cc.director.getWinSize();
var scrollView = new ccui.ScrollView();
scrollView.setDirection(ccui.ScrollView.DIR_VERTICAL);
scrollView.setTouchEnabled(true);
scrollView.setContentSize(cc.size(280, 150));
scrollView.x = winSize.width / 2;
scrollView.y = winSize.height / 2;
this.addChild(scrollView);
var imageView = new ccui.ImageView();
imageView.loadTexture(“res/cocosui/ccicon.png”);
var innerWidth = scrollView.width;
var innerHeight = scrollView.height + imageView.height;
scrollView.setInnerContainerSize(cc.size(innerWidth, innerHeight));
var button = new ccui.Button();
button.setTouchEnabled(true);
button.loadTextures(“res/cocosui/animationbuttonnormal.png”, “res/cocosui/animationbuttonpressed.png”, “”);
button.x = innerWidth / 2;
button.y = scrollView.getInnerContainerSize().height - button.height / 2;
scrollView.addChild(button);
var textButton = new ccui.Button();
textButton.setTouchEnabled(true);
textButton.loadTextures(“res/cocosui/backtotopnormal.png”, “res/cocosui/backtotoppressed.png”, “”);
textButton.setTitleText(“Text Button”);
textButton.x = innerWidth / 2;
textButton.y = button.getBottomBoundary() - button.height;
scrollView.addChild(textButton);
var button_scale9 = new ccui.Button();
button_scale9.setTouchEnabled(true);
button_scale9.setScale9Enabled(true);
button_scale9.loadTextures(“res/cocosui/button.png”, “res/cocosui/buttonHighlighted.png”, “”);
button_scale9.width = 100;
button_scale9.height = 32;
button_scale9.x = innerWidth / 2;
button_scale9.y = textButton.getBottomBoundary() - textButton.height;
scrollView.addChild(button_scale9);
imageView.x = innerWidth / 2;
imageView.y = imageView.height / 2;
scrollView.addChild(imageView);
return true;
}
});
is there any problem in my code
here is the screen shot of browser
here it is not working
and this is the screen shot of mac
here it is woking well
thanks