Ejemplo n.º 1
0
void ButtonControl::SetStyle(const GuiStyle& style)
{
	static const playstate::string FONT_KEY(SAFE_STRING("Button.Font>Font"));

	mFont = style.FindResource<Font>(FONT_KEY);
	
	static const playstate::string BACK_NORMAL_TOP_COLOR(SAFE_STRING("Button.Normal.BackColor.Top>Button.Normal.BackColor>Button.BackColor.Top>Button.BackColor>BackColor.Top>BackColor"));
	static const playstate::string BACK_NORMAL_BOTTOM_COLOR(SAFE_STRING("Button.Normal.BackColor.Bottom>Button.Normal.BackColor>Button.BackColor.Bottom>Button.BackColor>BackColor.Bottom>BackColor"));
	static const playstate::string BACK_HOVER_TOP_COLOR(SAFE_STRING("Button.Hover.BackColor.Top>Button.Hover.BackColor>Button.BackColor.Top>Button.BackColor>BackColor.Top>BackColor"));
	static const playstate::string BACK_HOVER_BOTTOM_COLOR(SAFE_STRING("Button.Hover.BackColor.Bottom>Button.Hover.BackColor>Button.BackColor.Bottom>Button.BackColor>BackColor.Bottom>BackColor"));
	static const playstate::string BACK_DOWN_TOP_COLOR(SAFE_STRING("Button.Down.BackColor.Top>Button.Down.BackColor>Button.BackColor.Top>Button.BackColor>BackColor.Top>BackColor"));
	static const playstate::string BACK_DOWN_BOTTOM_COLOR(SAFE_STRING("Button.Down.BackColor.Bottom>Button.Down.BackColor>Button.BackColor.Bottom>Button.BackColor>BackColor.Bottom>BackColor"));
	
	mButtonColors[0] = style.FindColor(BACK_NORMAL_TOP_COLOR, Color::Black);
	mButtonColors[1] = style.FindColor(BACK_NORMAL_BOTTOM_COLOR, Color::Black);
	mButtonColors[2] = style.FindColor(BACK_HOVER_TOP_COLOR, Color::Black);
	mButtonColors[3] = style.FindColor(BACK_HOVER_BOTTOM_COLOR, Color::Black);
	mButtonColors[4] = style.FindColor(BACK_DOWN_TOP_COLOR, Color::Black);
	mButtonColors[5] = style.FindColor(BACK_DOWN_BOTTOM_COLOR, Color::Black);
	
	static const playstate::string FONT_COLOR_NORMAL(SAFE_STRING("Button.Normal.FontColor>Button.FontColor>FontColor"));
	static const playstate::string FONT_COLOR_HOVER(SAFE_STRING("Button.Hover.FontColor>Button.FontColor>FontColor"));
	static const playstate::string FONT_COLOR_DOWN(SAFE_STRING("Button.Down.FontColor>Button.FontColor>FontColor"));
	
	mFontColors[0] = style.FindColor(FONT_COLOR_NORMAL, Color::Black);
	mFontColors[1] = style.FindColor(FONT_COLOR_HOVER, Color::Black);
	mFontColors[2] = style.FindColor(FONT_COLOR_DOWN, Color::Black);
}
Ejemplo n.º 2
0
void LabelControl::SetStyle(const GuiStyle& style)
{
    static const playstate::string FONT_KEY(SAFE_STRING("Label.Font>Font"));

    mFont = style.FindResource<Font>(FONT_KEY);

    mFontColor = style.FindColor(SAFE_STRING("Lable.FontColor"), Color::White);
}
Ejemplo n.º 3
0
void CanvasGroup::SetStyle(const GuiStyle& style)
{
	mStyle = style;

	mShadowOffset = style.FindInt(SAFE_STRING("ShadowOffset"), 0);
	mShadowColor = style.FindColor(SAFE_STRING("ShadowColor"), Color(0, 0, 0, 0.3f));

	mSliderControl.SetStyle(style);
	mLabelControl.SetStyle(style);
	mCheckboxControl.SetStyle(style);
	mButtonControl.SetStyle(style);
	mFrameControl.SetStyle(style);
}
Ejemplo n.º 4
0
void CheckboxControl::SetStyle(const GuiStyle& style)
{
	static const playstate::string FONT_KEY(SAFE_STRING("Checkbox.Font>Font"));

	mFont = style.FindResource<Font>(FONT_KEY);

	static const playstate::string FONT_COLOR_UNCHECKED(SAFE_STRING("Checkbox.Unchecked.FontColor>Checkbox.FontColor>FontColor"));
	static const playstate::string FONT_COLOR_CHECKED(SAFE_STRING("Checkbox.Checked.FontColor>Checkbox.FontColor>FontColor"));
	
	mFontColors[0] = style.FindColor(FONT_COLOR_UNCHECKED, Color::Black);
	mFontColors[1] = style.FindColor(FONT_COLOR_CHECKED, Color::Black);

	static const playstate::string CHECKBOX_SIZE(SAFE_STRING("Checkbox.BoxSize"));

	mCheckboxSize = (uint32)Math::Max(style.FindInt(CHECKBOX_SIZE, 20), 0);

	static const playstate::string BACK_NORMAL_TOP_COLOR(
		SAFE_STRING("Checkbox.Normal.BackColor.Top>Checkbox.Normal.BackColor>Checkbox.BackColor.Top>Checkbox.BackColor>BackColor.Top>BackColor"));
	static const playstate::string BACK_NORMAL_BOTTOM_COLOR(
		SAFE_STRING("Checkbox.Normal.BackColor.Bottom>Checkbox.Normal.BackColor>Checkbox.BackColor.Bottom>Checkbox.BackColor>BackColor.Bottom>BackColor"));
	static const playstate::string BACK_HOVER_TOP_COLOR(
		SAFE_STRING("Checkbox.Hover.BackColor.Top>Checkbox.Hover.BackColor>Checkbox.BackColor.Top>Checkbox.BackColor>BackColor.Top>BackColor"));
	static const playstate::string BACK_HOVER_BOTTOM_COLOR(
		SAFE_STRING("Checkbox.Hover.BackColor.Bottom>Checkbox.Hover.BackColor>Checkbox.BackColor.Bottom>Checkbox.BackColor>BackColor.Bottom>BackColor"));
	static const playstate::string BACK_DOWN_TOP_COLOR(
		SAFE_STRING("Checkbox.Down.BackColor.Top>Checkbox.Down.BackColor>Checkbox.BackColor.Top>Checkbox.BackColor>BackColor.Top>BackColor"));
	static const playstate::string BACK_DOWN_BOTTOM_COLOR(
		SAFE_STRING("Checkbox.Down.BackColor.Bottom>Checkbox.Down.BackColor>Checkbox.BackColor.Bottom>Checkbox.BackColor>BackColor.Bottom>BackColor"));

	mCheckboxColors[0] = style.FindColor(BACK_NORMAL_TOP_COLOR, Color::Black);
	mCheckboxColors[1] = style.FindColor(BACK_NORMAL_BOTTOM_COLOR, Color::Black);
	mCheckboxColors[2] = style.FindColor(BACK_HOVER_TOP_COLOR, Color::Black);
	mCheckboxColors[3] = style.FindColor(BACK_HOVER_BOTTOM_COLOR, Color::Black);
	mCheckboxColors[4] = style.FindColor(BACK_DOWN_TOP_COLOR, Color::Black);
	mCheckboxColors[5] = style.FindColor(BACK_DOWN_BOTTOM_COLOR, Color::Black);
}