bool CIwGameUITextView::setProperty(unsigned int element_name, CIwGameString& data, bool delta)
{
	if (CIwGameUIBase::setProperty(element_name, data, delta))
		return true;

	if (element_name == CIwGameXomlNames::MinZoom_Hash)
	{
		if (delta)
			setMinZoom(MinZoom + data.GetAsFloat());
		else
			setMinZoom(data.GetAsFloat());
	}
	else
	if (element_name == CIwGameXomlNames::MaxZoom_Hash)
	{
		if (delta)
			setMaxZoom(MaxZoom + data.GetAsFloat());
		else
			setMaxZoom(data.GetAsFloat());
	}
	else
	if (element_name == CIwGameXomlNames::Zoom_Hash)
	{
		if (delta)
			setZoom(Zoom + data.GetAsFloat());
		else
			setZoom(data.GetAsFloat());
	}
	else
		return false;

	return true;
}
Esempio n. 2
0
bool CIwGameUISlider::setProperty(unsigned int element_name, CIwGameString& data, bool delta)
{
	if (CIwGameUIBase::setProperty(element_name, data, delta))
		return true;

	float float_pool[8];

	if (element_name == CIwGameXomlNames::SliderSize_Hash)
	{
		SliderSize = data.GetAsInt();
	}
	else
	if (element_name == CIwGameXomlNames::Value_Hash)
	{
		Value = data.GetAsFloat();
	}
	else
	if (element_name == CIwGameXomlNames::ValueRange_Hash)
	{
		data.GetAsListOfFloat(float_pool);
		ValueRange.x = float_pool[0];
		ValueRange.y = float_pool[1];
	}
	else
	if (element_name == CIwGameXomlNames::SliderType_Hash)
	{
		unsigned int type_hash = data.getHash();

		if (type_hash == IW_GAME_HASH("vertical"))
			SliderType = SliderType_Vertical;
		else
			SliderType = SliderType_Horizontal;
	}
	else
		return false;

	return true;
}