当前位置: 首页>>代码示例>>C++>>正文


C++ UIElement::SetTexture方法代码示例

本文整理汇总了C++中UIElement::SetTexture方法的典型用法代码示例。如果您正苦于以下问题:C++ UIElement::SetTexture方法的具体用法?C++ UIElement::SetTexture怎么用?C++ UIElement::SetTexture使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在UIElement的用法示例。


在下文中一共展示了UIElement::SetTexture方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: InitDefaultElements

	void UIScrollBar::InitDefaultElements()
	{
		UIElement Element;

		// Track
		{
			Element.SetTexture(0, UIManager::Instance().ElementTextureRect(UICT_ScrollBar, 0));
			Element.TextureColor().States[UICS_Disabled] = Color(200.0f / 255, 200.0f / 255, 200.0f / 255, 1);

			elements_.push_back(MakeSharedPtr<UIElement>(Element));
		}

		// Up Arrow
		{
			Element.SetTexture(0, UIManager::Instance().ElementTextureRect(UICT_ScrollBar, 1));
			Element.TextureColor().States[UICS_Disabled] = Color(200.0f / 255, 200.0f / 255, 200.0f / 255, 1);

			elements_.push_back(MakeSharedPtr<UIElement>(Element));
		}

		// Down Arrow
		{
			Element.SetTexture(0, UIManager::Instance().ElementTextureRect(UICT_ScrollBar, 2));
			Element.TextureColor().States[UICS_Disabled] = Color(200.0f / 255, 200.0f / 255, 200.0f / 255, 1);

			elements_.push_back(MakeSharedPtr<UIElement>(Element));
		}

		// Button
		{
			Element.SetTexture(0, UIManager::Instance().ElementTextureRect(UICT_ScrollBar, 3));

			elements_.push_back(MakeSharedPtr<UIElement>(Element));
		}
	}
开发者ID:BitYorkie,项目名称:KlayGE,代码行数:35,代码来源:UIScrollBar.cpp

示例2: InitDefaultElements

	void UIButton::InitDefaultElements()
	{
		UIElement Element;

		// Button
		{
			Element.SetTexture(0, UIManager::Instance().ElementTextureRect(UICT_Button, 0));
			Element.SetFont(0);
			Element.TextureColor().States[UICS_Normal] = Color(1, 1, 1, 150.0f / 255);
			Element.TextureColor().States[UICS_Pressed] = Color(1, 1, 1, 200.0f / 255);
			Element.FontColor().States[UICS_MouseOver] = Color(0, 0, 0, 1.0f);

			elements_.push_back(MakeSharedPtr<UIElement>(Element));
		}

		// Fill layer
		{
			Element.SetTexture(0, UIManager::Instance().ElementTextureRect(UICT_Button, 1), Color(1, 1, 1, 0));
			Element.TextureColor().States[UICS_MouseOver] = Color(1, 1, 1, 160.0f / 255);
			Element.TextureColor().States[UICS_Pressed] = Color(0, 0, 0, 60.0f / 255);
			Element.TextureColor().States[UICS_Focus] = Color(1, 1, 1, 30.0f / 255);

			elements_.push_back(MakeSharedPtr<UIElement>(Element));
		}
	}
开发者ID:BitYorkie,项目名称:KlayGE,代码行数:25,代码来源:UIButton.cpp

示例3: InitDefaultElements

	void UIComboBox::InitDefaultElements()
	{
		UIElement Element;

		// Main
		{
			Element.SetTexture(0, UIManager::Instance().ElementTextureRect(UICT_ComboBox, 0));
			Element.SetFont(0);
			Element.TextureColor().States[UICS_Normal] = Color(200.0f / 255, 200.0f / 255, 200.0f / 255, 150.0f / 255);
			Element.TextureColor().States[UICS_Focus] = Color(230.0f / 255, 230.0f / 255, 230.0f / 255, 170.0f / 255);
			Element.TextureColor().States[UICS_Disabled] = Color(200.0f / 255, 200.0f / 255, 200.0f / 255, 70.0f / 255);
			Element.FontColor().States[UICS_MouseOver] = Color(0, 0, 0, 1);
			Element.FontColor().States[UICS_Pressed] = Color(0, 0, 0, 1);
			Element.FontColor().States[UICS_Disabled] = Color(200.0f / 255, 200.0f / 255, 200.0f / 255, 200.0f / 255);

			elements_.push_back(MakeSharedPtr<UIElement>(Element));
		}

		// Button
		{
			Element.SetTexture(0, UIManager::Instance().ElementTextureRect(UICT_ComboBox, 1));
			Element.TextureColor().States[UICS_Normal] = Color(1, 1, 1, 150.0f / 255);
			Element.TextureColor().States[UICS_Pressed] = Color(150.0f / 255, 150.0f / 255, 150.0f / 255, 1);
			Element.TextureColor().States[UICS_Focus] = Color(1, 1, 1, 200.0f / 255);
			Element.TextureColor().States[UICS_Disabled] = Color(1, 1, 1, 70.0f / 255);

			elements_.push_back(MakeSharedPtr<UIElement>(Element));
		}

		// Dropdown
		{
			Element.SetTexture(0, UIManager::Instance().ElementTextureRect(UICT_ComboBox, 2));
			Element.SetFont(0, Color(0, 0, 0, 1), Font::FA_Hor_Left | Font::FA_Ver_Top);

			elements_.push_back(MakeSharedPtr<UIElement>(Element));
		}

		// Selection
		{
			Element.SetTexture(0, UIManager::Instance().ElementTextureRect(UICT_ComboBox, 3));
			Element.SetFont(0, Color(1, 1, 1, 1), Font::FA_Hor_Left | Font::FA_Ver_Top);

			elements_.push_back(MakeSharedPtr<UIElement>(Element));
		}
	}
开发者ID:BobLChen,项目名称:KlayGE,代码行数:45,代码来源:UIComboBox.cpp

示例4: InitDefaultElements

	void UIListBox::InitDefaultElements()
	{
		UIElement Element;

		// Main
		{
			Element.SetTexture(0, UIManager::Instance().ElementTextureRect(UICT_ListBox, 0));
			Element.SetFont(0, Color(0, 0, 0, 1), Font::FA_Hor_Left | Font::FA_Ver_Top);

			elements_.push_back(MakeSharedPtr<UIElement>(Element));
		}

		// Selection
		{
			Element.SetTexture(0, UIManager::Instance().ElementTextureRect(UICT_ListBox, 1));
			Element.SetFont(0, Color(1, 1, 1, 1), Font::FA_Hor_Left | Font::FA_Ver_Top);

			elements_.push_back(MakeSharedPtr<UIElement>(Element));
		}
	}
开发者ID:BitYorkie,项目名称:KlayGE,代码行数:20,代码来源:UIListBox.cpp

示例5: InitDefaultElements

	void UISlider::InitDefaultElements()
	{
		UIElement Element;

		// Track
		{
			Element.SetTexture(0, UIManager::Instance().ElementTextureRect(UICT_Slider, 0));
			Element.TextureColor().States[UICS_Normal] = Color(1, 1, 1, 150.0f / 255);
			Element.TextureColor().States[UICS_Focus] = Color(1, 1, 1, 200.0f / 255);
			Element.TextureColor().States[UICS_Disabled] = Color(1, 1, 1, 70.0f / 255);

			elements_.push_back(MakeSharedPtr<UIElement>(Element));
		}

		// Button
		{
			Element.SetTexture(0, UIManager::Instance().ElementTextureRect(UICT_Slider, 1));

			elements_.push_back(MakeSharedPtr<UIElement>(Element));
		}
	}
开发者ID:Chenmxs,项目名称:KlayGE,代码行数:21,代码来源:UISlider.cpp

示例6: InitDefaultElements

	void UICheckBox::InitDefaultElements()
	{
		UIElement Element;

		// Box
		{
			Element.SetTexture(0, UIManager::Instance().ElementTextureRect(UICT_CheckBox, 0));
			Element.SetFont(0, Color(1, 1, 1, 1), Font::FA_Hor_Left | Font::FA_Ver_Middle);
			Element.FontColor().States[UICS_Disabled] = Color(200.0f / 255, 200.0f / 255, 200.0f / 255, 200.0f / 255);
			Element.TextureColor().States[UICS_Normal] = Color(1, 1, 1, 150.0f / 255);
			Element.TextureColor().States[UICS_Focus] = Color(1, 1, 1, 200.0f / 255);
			Element.TextureColor().States[UICS_Pressed] = Color(1, 1, 1, 1);

			elements_.push_back(MakeSharedPtr<UIElement>(Element));
		}

		// Check
		{
			Element.SetTexture(0, UIManager::Instance().ElementTextureRect(UICT_CheckBox, 1));

			elements_.push_back(MakeSharedPtr<UIElement>(Element));
		}
	}
开发者ID:Chenmxs,项目名称:KlayGE,代码行数:23,代码来源:UICheckBox.cpp

示例7: InitDefaultElements

	void UITexButton::InitDefaultElements()
	{
		UIElement Element;

		// Fill layer
		for (int i = 0; i < 9; ++ i)
		{
			Element.SetTexture(0, UIManager::Instance().ElementTextureRect(UICT_TexButton, i), Color(1, 1, 1, 0));
			Element.TextureColor().States[UICS_MouseOver] = Color(1, 1, 1, 1);
			Element.TextureColor().States[UICS_Pressed] = Color(0, 0, 0, 60.0f / 255);
			Element.TextureColor().States[UICS_Focus] = Color(1, 1, 1, 30.0f / 255);

			elements_.push_back(MakeUniquePtr<UIElement>(Element));
		}

		// Button
		{
			TexturePtr const & tex = UIManager::Instance().GetTexture(tex_index_);

			if (tex)
			{
				Element.SetTexture(static_cast<uint32_t>(tex_index_), IRect(0, 0, tex->Width(0), tex->Height(0)));
			}
			else
			{
				Element.SetTexture(static_cast<uint32_t>(tex_index_), IRect(0, 0, 1, 1));
			}
			Element.SetFont(0);
			Element.TextureColor().States[UICS_MouseOver] = Color(1, 1, 1, 1);
			Element.TextureColor().States[UICS_Normal] = Color(1, 1, 1, 1);
			Element.TextureColor().States[UICS_Pressed] = Color(1, 1, 1, 1);
			Element.FontColor().States[UICS_MouseOver] = Color(0, 0, 0, 1);

			elements_.push_back(MakeUniquePtr<UIElement>(Element));
		}
	}
开发者ID:zsnake1209,项目名称:KlayGE,代码行数:36,代码来源:UITexButton.cpp

示例8: InitDefaultElements

	void UIEditBox::InitDefaultElements()
	{
		UIElement Element;

		// Element assignment:
		//   0 - text area
		//   1 - top left border
		//   2 - top border
		//   3 - top right border
		//   4 - left border
		//   5 - right border
		//   6 - lower left border
		//   7 - lower border
		//   8 - lower right border

		Element.SetFont(0, Color(0, 0, 0, 1), Font::FA_Hor_Left | Font::FA_Ver_Top);

		// Assign the style
		{
			Element.SetTexture(0, UIManager::Instance().ElementTextureRect(UICT_EditBox, 0));

			elements_.push_back(MakeSharedPtr<UIElement>(Element));
		}

		{
			Element.SetTexture(0, UIManager::Instance().ElementTextureRect(UICT_EditBox, 1));

			elements_.push_back(MakeSharedPtr<UIElement>(Element));
		}

		{
			Element.SetTexture(0, UIManager::Instance().ElementTextureRect(UICT_EditBox, 2));

			elements_.push_back(MakeSharedPtr<UIElement>(Element));
		}

		{
			Element.SetTexture(0, UIManager::Instance().ElementTextureRect(UICT_EditBox, 3));

			elements_.push_back(MakeSharedPtr<UIElement>(Element));
		}

		{
			Element.SetTexture(0, UIManager::Instance().ElementTextureRect(UICT_EditBox, 4));

			elements_.push_back(MakeSharedPtr<UIElement>(Element));
		}

		{
			Element.SetTexture(0, UIManager::Instance().ElementTextureRect(UICT_EditBox, 5));

			elements_.push_back(MakeSharedPtr<UIElement>(Element));
		}

		{
			Element.SetTexture(0, UIManager::Instance().ElementTextureRect(UICT_EditBox, 6));

			elements_.push_back(MakeSharedPtr<UIElement>(Element));
		}

		{
			Element.SetTexture(0, UIManager::Instance().ElementTextureRect(UICT_EditBox, 7));

			elements_.push_back(MakeSharedPtr<UIElement>(Element));
		}

		{
			Element.SetTexture(0, UIManager::Instance().ElementTextureRect(UICT_EditBox, 8));

			elements_.push_back(MakeSharedPtr<UIElement>(Element));
		}

		WindowPtr const & main_wnd = Context::Instance().AppInstance().MainWnd();
		on_char_connect_ = main_wnd->OnChar().connect(bind(&UIEditBox::CharHandler, this,
			placeholders::_1, placeholders::_2));
	}
开发者ID:,项目名称:,代码行数:76,代码来源:


注:本文中的UIElement::SetTexture方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。