本文整理汇总了C++中CCScene::getContentSize方法的典型用法代码示例。如果您正苦于以下问题:C++ CCScene::getContentSize方法的具体用法?C++ CCScene::getContentSize怎么用?C++ CCScene::getContentSize使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CCScene
的用法示例。
在下文中一共展示了CCScene::getContentSize方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: createScene
void DemoKeeper::createScene()
{
//MyGUI::LayoutManager::getInstance().loadLayout("Wallpaper.layout");
//const MyGUI::VectorWidgetPtr& root = MyGUI::LayoutManager::getInstance().loadLayout("HelpPanel.layout");
//root.at(0)->findWidget("Text")->castType<MyGUI::TextBox>()->setCaption("Demonstration of using different widgets and styles (something like Ogre Demo_Gui).");
mMainPanel = new MainPanel();
mMainPanel->eventAction = MyGUI::newDelegate(this, &DemoKeeper::notifyEventAction);
mMainPanel->addObject("FrameWindow");
mMainPanel->addObject("Horizontal Scrollbar");
mMainPanel->addObject("Vertical Scrollbar");
mMainPanel->addObject("TextBox");
mMainPanel->addObject("ImageBox");
mMainPanel->addObject("Render to Texture");
mEditorWindow = new EditorWindow();
MyGUI::FontManager& fontmanager = MyGUI::FontManager::getInstance();
MyGUI::IFont* font = fontmanager.getByName(fontmanager.getDefaultFont());
#ifdef MYGUI_COCOS2D_PLATFORM
CCScene* scene = HelloWorld::scene();
cocos2d::CCDirector::sharedDirector()->runWithScene(scene);
MyGUI::Cocos2dTexture* texture = (MyGUI::Cocos2dTexture*)font->getTextureFont();
CCSprite* fontTexture = CCSprite::createWithTexture(texture->getCocos2dTexture());
scene->addChild(fontTexture);
fontTexture->setPosition(CCPoint(scene->getContentSize().width / 2, scene->getContentSize().height / 2));
#endif
}
示例2:
CCScene *WCGame::scene() {
CCScene *scene = CCScene::create();
CCSprite *bg = CCSprite::create("bggame1.jpg");
bg->setPosition(CCPoint(scene->getContentSize().width / 2, scene->getContentSize().height / 2));
WCGame *layer = WCGame::create();
scene->addChild(bg, 0);
scene->addChild(layer, 1);
return scene;
}