Exemple #1
0
void ofxTextLabel_<T>::setup(T * font, const string& text, const ofRectangle& drawBounds, float lineSpacing, ofAlignHorz alignHorz, ofAlignVert alignVert)
{
    setFont(font);
    setText(text);
    setDrawBounds(drawBounds);
    setLineSpacing(lineSpacing);
    setAlignHorz(alignHorz);
    setAlignVert(alignVert);
}
Exemple #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", 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);
}