前端之家收集整理的这篇文章主要介绍了
cocos2d-x scrollView 滚动窗口,
前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
void ImportJson::importJsonFile()
{
CCNode * node = CCNode::create();
for (int i = 0; i < 8; i++)
{
CCSprite * spr = CCSprite::create(Common::format(i + 1,"select",".jpg"));
node->addChild(spr);
spr->setPosition(ccp(winSize.width / 2,winSize.height / 2));
}
CCScrollView * view = CCScrollView::create(winSize,node);
addChild(view);
view->setContentSize(CCSizeMake(8*winSize.width,winSize.height));
view->setDirectoin(kCCScrollViewDirectionHorizontal);
}
原文链接:https://www.f2er.com/cocos2dx/345133.html