本文整理汇总了C++中CCLabelTTF::getDimensions方法的典型用法代码示例。如果您正苦于以下问题:C++ CCLabelTTF::getDimensions方法的具体用法?C++ CCLabelTTF::getDimensions怎么用?C++ CCLabelTTF::getDimensions使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CCLabelTTF
的用法示例。
在下文中一共展示了CCLabelTTF::getDimensions方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: init
bool InterfaceRenderer::init() {
if( !CCLayer::init() )
return false;
CCSize designResolutionSize = CCEGLView::sharedOpenGLView()->getDesignResolutionSize();
CCLabelTTF* label = CCLabelTTF::create("분당우리교회 청년2부 행복나무", "Arial", 100);
label->setAnchorPoint(ccp(0.5f, 1));
label->setPosition(ccp(designResolutionSize.width/2, designResolutionSize.height-label->getDimensions().height));
this->addChild(label);
// {
// editbox = CCEditBox::create(CCSizeMake(800, 100), CCScale9Sprite::create("green_edit.png"));
// editbox->retain();
// editbox->setPosition(ccp(designResolutionSize.width/2, 10));
// editbox->setAnchorPoint(ccp(0.5f, 0));
// editbox->setPlaceHolder("테스트용 단어를 입력해주세요.");
// editbox->setFont("Arial", 60);
// editbox->setFontColor(ccBLACK);
// this->addChild(editbox);
// }
CCMenuItemFont::setFontSize(80);
CCMenuItemFont::setFontName("Arial");
// for test button
// {
// CCMenuItemFont* item = CCMenuItemFont::create("Add", this, menu_selector(InterfaceRenderer::onTouchedDone));
// item->setAnchorPoint(ccp(0, 0));
// item->setPosition(ccp(editbox->getContentSize().width+10, 0));
//
// CCMenuItemFont* printItem = CCMenuItemFont::create("Print", this, menu_selector(InterfaceRenderer::onTouchedPrint));
// printItem->setAnchorPoint(ccp(0, 0));
// printItem->setPosition(ccp(editbox->getContentSize().width+10*2+item->boundingBox().size.width, 0));
//
// CCMenu* menu = CCMenu::create(item,printItem,NULL);
// menu->setPosition(ccp(0, 0));
// menu->setAnchorPoint(ccp(0, 0));
// editbox->addChild(menu);
// }
// for menually refresh button
{
CCMenuItemFont* item1 = CCMenuItemFont::create("requestWord", this, menu_selector(InterfaceRenderer::onTouchedRequestWord));
CCMenuItemFont* item2 = CCMenuItemFont::create("requestMistake", this, menu_selector(InterfaceRenderer::onTouchedRequestMistake));
CCMenu* menu = CCMenu::create(item1, item2, NULL);
menu->alignItemsVerticallyWithPadding(10);
this->addChild(menu);
}
return true;
}