本文整理汇总了C++中ToggleButton::setPosition方法的典型用法代码示例。如果您正苦于以下问题:C++ ToggleButton::setPosition方法的具体用法?C++ ToggleButton::setPosition怎么用?C++ ToggleButton::setPosition使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ToggleButton
的用法示例。
在下文中一共展示了ToggleButton::setPosition方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: createCheckboxShowRealFPS
/*************************************************************************
Creates a checkbox to let the user choose to display randomised or real FPS value
*************************************************************************/
void CustomShapesDrawingSample::createCheckboxShowRealFPS()
{
WindowManager& winMgr = WindowManager::getSingleton();
// We create a button and subscribe to its click events
ToggleButton* checkboxShowRealFPS = static_cast<CEGUI::ToggleButton*>(winMgr.createWindow("WindowsLook/Checkbox"));
checkboxShowRealFPS->setSize(CEGUI::USize(cegui_reldim(0.25f), cegui_reldim(0.035f)));
checkboxShowRealFPS->setHorizontalAlignment(HA_CENTRE);
checkboxShowRealFPS->setPosition(CEGUI::UVector2(cegui_reldim(0.0f), cegui_reldim(0.13f)));
checkboxShowRealFPS->setText("Show randomly generated FPS values");
checkboxShowRealFPS->subscribeEvent(ToggleButton::EventSelectStateChanged, Event::Subscriber(&CustomShapesDrawingSample::handleToggleButtonShowRandomisedFpsSelectionChanged, this));
checkboxShowRealFPS->setSelected(true);
d_root->addChild(checkboxShowRealFPS);
}
示例2: initButtons
void UILayer::initButtons( void )
{
//정지 팝업띄우는 버튼
Button* stop = Button::buttonWithFrameImageFile("stop.png", "stop.png");
stop->setPosition(DTool::getCenter(this) + Vec2(264, 456));
stop->addAction([this]()
{
PopupStop* popupStop = PopupStop::create("", "popup_stop.png");
popupStop->showPopup(this);
},
TOUCH_DOWN);
addChild(stop);
//하트버튼
ToggleButton* heart = ToggleButton::buttonWithFrameImageFile("btn_heart_on.png", "btn_heart_off.png");
heart->setPosition(DTool::getCenter(this) + Vec2(254, 180));
addChild(heart);
}