Exemplo n.º 1
0
void ParticleEvolver::AddEvolutionStage(const TiXmlAttribute* attribute)
{
	auto v = ParseVector2f(attribute->Value());
	if (StringStartsWith("evol_red", attribute->Name()))
	{
		m_redEvolution.push_back(std::make_pair(v.x, (uint)v.y));
	}
	else if (StringStartsWith("evol_green", attribute->Name()))
	{
		m_greenEvolution.push_back(std::make_pair(v.x, (uint)v.y));
	}
	else if (StringStartsWith("evol_blue", attribute->Name()))
	{
		m_blueEvolution.push_back(std::make_pair(v.x, (uint)v.y));
	}
	else if (StringStartsWith("evol_alpha", attribute->Name()))
	{
		m_alphaEvolution.push_back(std::make_pair(v.x, (uint)v.y));
	}
	else if (StringStartsWith("evol_scaleX", attribute->Name()))
	{
		m_scaleEvolutionX.push_back(std::make_pair(v.x, v.y));
	}
	else if (StringStartsWith("evol_scaleY", attribute->Name()))
	{
		m_scaleEvolutionY.push_back(std::make_pair(v.x, v.y));
	}
}
Exemplo n.º 2
0
void ButtonComponent::ParseAttribute(const TiXmlAttribute* attribute)
{
	Component::ParseAttribute(attribute);
	if (IsEqual(attribute->Name(), "texture_focused"))
	{
		SetTexture(FOCUSED, attribute->Value());
	}
	else if (IsEqual(attribute->Name(), "texture_unfocused"))
	{
		SetTexture(UNFOCUSED, attribute->Value());
	}
	else if (IsEqual(attribute->Name(), "size"))
	{
		SetSize(ParseVector2f(attribute->Value()));
	}
	else if (IsEqual(attribute->Name(), "next_menu"))
	{
		m_nextMenu = attribute->Value();
	}
	else if (IsEqual(attribute->Name(), "type"))
	{
		SetType(GetTypeIndex(attribute->Value()));
	}
	else if (IsEqual(attribute->Name(), "style"))
	{
		SetStyle(GetStyleIndex(attribute->Value()));
	}
	else if (IsEqual(attribute->Name(), "text"))
	{
		SetText(attribute->Value());
	}
	else if (IsEqual(attribute->Name(), "text_font"))
	{
		SetTextFont(attribute->Value());
	}
	else if (IsEqual(attribute->Name(), "text_size"))
	{
		SetFontSize(attribute->UnsignedValue());
	}
	else if (IsEqual(attribute->Name(), "text_color"))
	{
		SetTextColor(ParseVector3f(attribute->Value()));
	}
	else if (IsEqual(attribute->Name(), "text_highlight_color"))
	{
		SetHighlightTextColor(ParseVector3f(attribute->Value()));
	}
	else if (IsEqual(attribute->Name(), "has_textures"))
	{
		SetIfHasTextures(attribute->BoolValue());
	}
	else if (IsEqual(attribute->Name(), "text_highlights"))
	{
		SetIfTextHighlights(attribute->BoolValue());
	}
}
Exemplo n.º 3
0
void PlayerHpBar::ParseAttribute(const TiXmlAttribute* attribute)
{
	if (IsEqual(attribute->Name(), "avatar_texture"))
	{
		SetTexture("avatar", attribute->Value());
	}
	else if (IsEqual(attribute->Name(), "frame_texture"))
	{
		SetTexture("frame", attribute->Value());
	}
	else if (IsEqual(attribute->Name(), "green_bar_texture"))
	{
		SetTexture("green_bar", attribute->Value());
	}
	else if (IsEqual(attribute->Name(), "avatar_offset"))
	{
		SetOffset("avatar", ParseVector2f(attribute->Value()));
	}
	else if (IsEqual(attribute->Name(), "bar_offset"))
	{
		SetOffset("bar", ParseVector2f(attribute->Value()));
	}
}
Exemplo n.º 4
0
void CheckboxComponent::ParseAttribute(const TiXmlAttribute* attribute)
{
	Component::ParseAttribute(attribute);
	if (IsEqual(attribute->Name(), "texture_focused"))
	{
		SetTexture(FOCUSED, attribute->Value());
	}

	else if (IsEqual(attribute->Name(), "texture_unfocused"))
	{
		SetTexture(UNFOCUSED, attribute->Value());
	}

	else if (IsEqual(attribute->Name(), "size"))
	{
		SetSize(ParseVector2f(attribute->Value()));
	}

	else if (IsEqual(attribute->Name(), "texture_check"))
	{
		SetCheckSprite(attribute->Value());
	}
}