Ejemplo n.º 1
0
	//! Reads attributes of the element
	void CGUIButton::deserializeAttributes(IAttributes* in, SAttributeReadWriteOptions* options = 0)
	{
		IGUIButton::deserializeAttributes(in, options);

		IsPushButton = in->getAttributeAsBool("PushButton");
		Pressed = IsPushButton ? in->getAttributeAsBool("Pressed") : false;

		rect<SINT32> rec = in->getAttributeAsRect("ImageRect");
		if (rec.isValid())
			setImage(in->getAttributeAsTexture("Image"), rec);
		else
			setImage(in->getAttributeAsTexture("Image"));

		rec = in->getAttributeAsRect("PressedImageRect");
		if (rec.isValid())
			setPressedImage(in->getAttributeAsTexture("PressedImage"), rec);
		else
			setPressedImage(in->getAttributeAsTexture("PressedImage"));

		setDrawBorder(in->getAttributeAsBool("Border"));
		setUseAlphaChannel(in->getAttributeAsBool("UseAlphaChannel"));
		setScaleImage(in->getAttributeAsBool("ScaleImage"));

		//   setOverrideFont(in->getAttributeAsString("OverrideFont"));

		updateAbsolutePosition();
	}
Ejemplo n.º 2
0
//! Reads attributes of the element
void CGUIImage::deserializeAttributes(io::IAttributes* in, io::SAttributeReadWriteOptions* options=0)
{
	IGUIImage::deserializeAttributes(in,options);

	setImage(in->getAttributeAsTexture("Texture"));
	setUseAlphaChannel(in->getAttributeAsBool("UseAlphaChannel"));

}
Ejemplo n.º 3
0
	//! Reads attributes of the element
	void CGUIImage::deserializeAttributes(IAttributes* in, SAttributeReadWriteOptions* options = 0)
	{
		IGUIImage::deserializeAttributes(in, options);

		setImage(in->getAttributeAsTexture("Texture"));
		setUseAlphaChannel(in->getAttributeAsBool("UseAlphaChannel"));
		setColor(in->getAttributeAsColor("Color"));
		setScaleImage(in->getAttributeAsBool("ScaleImage"));
	}
Ejemplo n.º 4
0
//! Reads attributes of the element
void CGUIImage::deserializeAttributes(io::IAttributes* in, io::SAttributeReadWriteOptions* options=0)
{
	IGUIImage::deserializeAttributes(in,options);

	setImage(in->getAttributeAsTexture("Texture", Texture));
	setUseAlphaChannel(in->getAttributeAsBool("UseAlphaChannel", UseAlphaChannel));
	setColor(in->getAttributeAsColor("Color", Color));
	setScaleImage(in->getAttributeAsBool("ScaleImage", UseAlphaChannel));
	setSourceRect(in->getAttributeAsRect("SourceRect", SourceRect));

	DrawBounds.UpperLeftCorner.X = in->getAttributeAsFloat("DrawBoundsX1", DrawBounds.UpperLeftCorner.X);
	DrawBounds.UpperLeftCorner.Y = in->getAttributeAsFloat("DrawBoundsY1", DrawBounds.UpperLeftCorner.Y);
	DrawBounds.LowerRightCorner.X = in->getAttributeAsFloat("DrawBoundsX2", DrawBounds.LowerRightCorner.X);
	DrawBounds.LowerRightCorner.Y = in->getAttributeAsFloat("DrawBoundsY2", DrawBounds.LowerRightCorner.Y);
	setDrawBounds(DrawBounds);
}
Ejemplo n.º 5
0
//! Reads attributes of the element
void CGUIButton::deserializeAttributes(io::IAttributes* in, io::SAttributeReadWriteOptions* options=0)
{
	IGUIButton::deserializeAttributes(in,options);

	IsPushButton = in->getAttributeAsBool("PushButton", IsPushButton);
	Pressed		 = IsPushButton ? in->getAttributeAsBool("Pressed", Pressed) : false;

	for ( u32 i=0; i<(u32)EGBIS_COUNT; ++i )
	{
		core::stringc nameRect( GUIButtonImageStateNames[i] );
		nameRect += "Rect";

		setImage((EGUI_BUTTON_IMAGE_STATE)i,
				in->getAttributeAsTexture(GUIButtonImageStateNames[i], ButtonImages[i].Texture),
				in->getAttributeAsRect(nameRect.c_str(), ButtonImages[i].SourceRect) );
	}

	setDrawBorder(in->getAttributeAsBool("Border", DrawBorder));
	setUseAlphaChannel(in->getAttributeAsBool("UseAlphaChannel", UseAlphaChannel));
	setScaleImage(in->getAttributeAsBool("ScaleImage", ScaleImage));

	for ( u32 i=0; i<(u32)EGBS_COUNT; ++i )
	{
		core::stringc nameIndex( GUIButtonStateNames[i] );
		nameIndex += "Index";
		ButtonSprites[i].Index = in->getAttributeAsInt(nameIndex.c_str(), ButtonSprites[i].Index );

		core::stringc nameColor( GUIButtonStateNames[i] );
		nameColor += "Color";
		ButtonSprites[i].Color = in->getAttributeAsColor(nameColor.c_str(), ButtonSprites[i].Color );

		core::stringc nameLoop( GUIButtonStateNames[i] );
		nameLoop += "Loop";
		ButtonSprites[i].Loop = in->getAttributeAsBool(nameLoop.c_str(), ButtonSprites[i].Loop );

		core::stringc nameScale( GUIButtonStateNames[i] );
		nameScale += "Scale";
		ButtonSprites[i].Scale = in->getAttributeAsBool(nameScale.c_str(), ButtonSprites[i].Scale );
	}

	//   setOverrideFont(in->getAttributeAsString("OverrideFont"));

	updateAbsolutePosition();
}