本文整理汇总了C++中CSlider::SetName方法的典型用法代码示例。如果您正苦于以下问题:C++ CSlider::SetName方法的具体用法?C++ CSlider::SetName怎么用?C++ CSlider::SetName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CSlider
的用法示例。
在下文中一共展示了CSlider::SetName方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: LoadSlider
void CGUIWindow::LoadSlider (CSlider** slider_aux, CXMLTreeNode& pNewNode, const Vect2i& screenResolution, CTextureManager* tm)
{
//<Slider name="debug_fps" posx="0" posy="2" height="10" width="10" visible="true" active="true" value="0.5" buttonH="10" buttonW="10"
// button_normal="blabla" button_over="bla" button_clicked"bla" button_deactivated="bla" quad="bla"
// OnOverAction="" OnClickedAction="" OnChangeValue="" OnSaveValue="blabl" OnLoadValue="" Literal="blabla" widthOffset="" heightOffset=""/>
CSlider* slider;
std::string name = pNewNode.GetPszProperty("name", "defaultGuiElement");
float posx = pNewNode.GetFloatProperty("posx", 0.f);
float posy = pNewNode.GetFloatProperty("posy", 0.f);
float w = pNewNode.GetFloatProperty("width", 50.f);
float h = pNewNode.GetFloatProperty("height", 50.f);
bool visible = pNewNode.GetBoolProperty("visible", true);
bool activated = pNewNode.GetBoolProperty("active", true);
float value = pNewNode.GetFloatProperty("value", 0.f);
float buttonH = pNewNode.GetFloatProperty("buttonH", 10.f);
float buttonW = pNewNode.GetFloatProperty("buttonW", 10.f);
std::string button_normal = pNewNode.GetPszProperty("button_normal", "");
std::string button_over = pNewNode.GetPszProperty("button_over", "");
std::string button_clicked = pNewNode.GetPszProperty("button_clicked", "");
std::string button_deactivated = pNewNode.GetPszProperty("button_deactivated", "");
std::string quad = pNewNode.GetPszProperty("quad", "");
std::string OnChangeValue = pNewNode.GetPszProperty("OnChangeValue", "");
std::string OnClickedAction = pNewNode.GetPszProperty("OnClickedAction", "");
std::string OnOverAction = pNewNode.GetPszProperty("OnOverAction", "");
std::string OnSaveValue = pNewNode.GetPszProperty("OnSaveValue", "");
std::string OnLoadValue = pNewNode.GetPszProperty("OnLoadValue", "");
std::string l_literal = pNewNode.GetPszProperty("Literal", "");
float widthOffsetPercent = pNewNode.GetFloatProperty("widthOffset", 0.f);
float heightOffsetPercent = pNewNode.GetFloatProperty("heightOffset", 0.f);
CTexture* normal = tm->GetTexture(button_normal);
CTexture* over = tm->GetTexture(button_over);
CTexture* deac = tm->GetTexture(button_deactivated);
CTexture* clicked = tm->GetTexture(button_clicked);
CTexture* back = tm->GetTexture(quad);
uint32 widthOffset = (uint32) (screenResolution.x * 0.01f * widthOffsetPercent );
uint32 heightOffset = (uint32) (screenResolution.y * 0.01f * heightOffsetPercent );
slider = new CSlider( screenResolution.y, screenResolution.x, h, w, Vect2f(posx,posy), buttonW, buttonH, value,
l_literal, heightOffset, widthOffset, visible, activated);
slider->SetName(name);
slider->SetButtonTextures(normal, over, clicked, deac);
slider->SetBackGroundTexture(back);
slider->SetOnChangeValueAction(OnChangeValue);
slider->SetOnClickedAction(OnClickedAction);
slider->SetOnOverAction(OnOverAction);
slider->SetOnLoadValueAction(OnLoadValue);
slider->SetOnSaveValueAction(OnSaveValue);
*slider_aux = slider;
}