我正在使用cocostudio并导出一个场景,其中它导出了一个.plist、.png和一个.json file.The场景,在iPhoneRetin3.5英寸上运行良好,但是在ipad和iphone.How中,缩放并不完美,我们使用.json控制缩放,并在我编写的init功能中导入一个完整的场景uin不同的设备。
CCNode *pFishJoyScene = SceneReader::sharedSceneReader()->createNodeWithSceneFile("FishJoy2.json");
this->addChild(pFishJoyScene);
cocos2d::extension::ActionManager::shareManager()->playActionByName("startMenu_1.json","Animation1"); 更早的时候,我使用CCSize,CCSize,使用它,我用它来缩放所有的东西。
但是如果是json,我们不需要写这个,因为我们正在cocostudio.Please中创建一个场景,告诉我如何在使用.json时控制不同设备上的缩放
我从https://github.com/chukong/CocoStudioSamples上拿了一些例子
我在上面的示例DemoFishingjoy.If中运行了一个项目--在不同的设备中运行这个示例项目--它将导致扩展problems.Please帮助
发布于 2014-03-11 04:24:24
好吧,答案是,无论我采取什么,无论是场景,还是任何东西,我都把它作为node.Just规模,节点和所有东西都将是perfect.For的例子
CCNode *pFishJoyScene = SceneReader::sharedSceneReader()->createNodeWithSceneFile("FishJoy2.json");
this->addChild(pFishJoyScene);
cocos2d::extension::ActionManager::shareManager()->playActionByName("startMenu_1.json","Animation1");
CCSprite *bg=CCSprite::create("startMenuBG.png");
float rX=winSize.width/bg->getContentSize().width;
float rY = winSize.height/bg->getContentSize().height;
pFishJoyScene->setScaleX(rX);
pFishJoyScene->setScaleY(rY);然后你会在任何设备中看到它工作的完美。
发布于 2014-03-05 10:36:06
I hope this will help you.for scaling in skeletonAnimation setScaleX() and setScaleY() are used
CCSkeletonAnimation* skeletonAnimRun = CCSkeletonAnimation::createWithFile("horse.json", "horse.atlas");
skeletonAnimRun->setAnimation("run", true);
skeletonAnimRun->timeScale = 1.0f;
skeletonAnimRun->setScaleX(.2f);
skeletonAnimRun->setScaleY(.2f);
skeletonAnimRun->setPosition(x/5, y/2);
skeletonAnimRun->setSkin("black");
skeletonAnimRun->setSlotsToSetupPose();
addChild(skeletonAnimRun,10);https://stackoverflow.com/questions/22188712
复制相似问题