本文整理汇总了C++中TextWidget::SetPos方法的典型用法代码示例。如果您正苦于以下问题:C++ TextWidget::SetPos方法的具体用法?C++ TextWidget::SetPos怎么用?C++ TextWidget::SetPos使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TextWidget
的用法示例。
在下文中一共展示了TextWidget::SetPos方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: init
void init() {
{
ButtonWidget * cb = new ButtonWidget(Vec2i(0, 0), "graph/interface/icons/menu_main_save");
cb->SetCheckOff();
addCenter(cb, true);
}
{
std::string szMenuText = getLocalised("system_menu_editquest_newsavegame", "---");
TextWidget * me = new TextWidget(BUTTON_INVALID, hFontMenu, szMenuText, Vec2i(RATIO_X(20), 0));
me->m_savegame = SavegameHandle::Invalid;
me->eState=EDIT;
me->ePlace=CENTER;
addCenter(me, true);
}
HorizontalPanelWidget * pPanel = new HorizontalPanelWidget;
// Delete button
{
std::string szMenuText = getLocalised("system_menus_main_editquest_delete");
TextWidget * me = new TextWidget(BUTTON_MENUEDITQUEST_DELETE, hFontMenu, szMenuText, Vec2i(0, 0));
me->m_targetMenu = EDIT_QUEST_SAVE;
me->SetPos(Vec2i(RATIO_X(m_size.x-10)-me->m_rect.width(), RATIO_Y(5)));
me->lOldColor = me->lColor;
pPanel->AddElementNoCenterIn(me);
pDeleteButton = me;
}
// Save button
{
std::string szMenuText = getLocalised("system_menus_main_editquest_save");
TextWidget * me = new TextWidget(BUTTON_MENUEDITQUEST_SAVE, hFontMenu, szMenuText, Vec2i(0, 0));
me->m_targetMenu = MAIN;
me->SetPos(Vec2i(RATIO_X(m_size.x-10)-me->m_rect.width(), RATIO_Y(380)));
pPanel->AddElementNoCenterIn(me);
}
// Back button
{
ButtonWidget * cb = new ButtonWidget(RATIO_2(Vec2i(20, 380)), "graph/interface/menus/back");
cb->m_targetMenu = EDIT_QUEST_SAVE;
cb->SetShortCut(Keyboard::Key_Escape);
pPanel->AddElementNoCenterIn(cb);
}
add(pPanel);
}