500 Size winSize = Director::getInstance()->getVisibleSize();
513 HBox *upperHBox = HBox::create();
514 upperHBox->setTag(-200);
517 LinearLayoutParameter *params = LinearLayoutParameter::create();
518 params->setMargin(Margin(0.0f,0.0f,50.0f,0.0f));
520 LinearLayoutParameter *vparams = LinearLayoutParameter::create();
521 vparams->setMargin(Margin(10.0f, 0.0f, 0.0f, 140.0f));
522 upperHBox->setLayoutParameter(vparams);
525 for (
int i=0; i<count; ++i) {
526 VBox *firstVbox = VBox::create();
527 firstVbox->setScale(0.5);
528 firstVbox->setLayoutParameter(params);
529 firstVbox->setTag((i+1) * 100);
532 for (
int j=0; j<count1; ++j) {
533 ImageView *w = ImageView::create(
"cocosui/scrollviewbg.png");
534 w->setTouchEnabled(
true);
535 w->setTag(j+firstVbox->getTag()+1);
537 firstVbox->addChild(w);
540 upperHBox->addChild(firstVbox);
544 HBox *bottomHBox = HBox::create();
545 bottomHBox->setScale(0.5);
546 bottomHBox->setTag(600);
548 bottomHBox->setLayoutParameter(vparams);
550 LinearLayoutParameter *bottomParams = LinearLayoutParameter::create();
551 bottomParams->setMargin(Margin(0.0f, 0.0f, 8.0f, 0.0f));
552 for (
int i=0; i < count; ++i) {
553 ImageView *w = ImageView::create(
"cocosui/scrollviewbg.png");
554 w->setLayoutParameter(bottomParams);
555 w->setTouchEnabled(
true);
558 bottomHBox->addChild(w);
564 _loopText = Text::create(
"loop enabled",
"Arial", 20);
565 _loopText->setPosition(Vec2(winSize.width/2, winSize.height - 50));
cocos2d::ui::Widget * _firstFocusedWidget
virtual bool init() override
void onImageViewClicked(cocos2d::Ref *ref, cocos2d::ui::Widget::TouchEventType touchType)
cocos2d::ui::Button * _toggleButton
void toggleFocusLoop(cocos2d::Ref *, cocos2d::ui::Widget::TouchEventType)
cocos2d::ui::Layout * _verticalLayout
cocos2d::ui::Text * _loopText
cocos2d::Layer * _uiLayer