Esempio n. 1
0
void GuiLabel::SetupDrawable(
	SceneNode & scene,
	const Font & font, int align,
	float scalex, float scaley,
	float x, float y,
	float w, float h, float z)
{
	m_font = &font;
	m_x = x;
	m_y = y;
	m_w = w;
	m_h = h;
	m_scalex = scalex;
	m_scaley = scaley;
	m_align = align;

	m_draw = scene.GetDrawlist().text.insert(Drawable());
	Drawable & drawref = GetDrawable(scene);
	drawref.SetDrawOrder(z);

	float textw = 0;
	if (align == -1) x -= w * 0.5;
	else if (align == 0) x -= textw * 0.5;
	else if (align == 1) x -= (textw - w * 0.5);
	m_text_draw.Set(drawref, font, m_text, x, y, scalex, scaley, m_r, m_g, m_b);
}
Esempio n. 2
0
static void EraseTextDrawable(SceneNode & node, keyed_container<Drawable>::handle & drawhandle)
{
	if (drawhandle.valid())
	{
		node.GetDrawlist().twodim.erase(drawhandle);
		drawhandle.invalidate();
	}
}
Esempio n. 3
0
static keyed_container<Drawable>::handle AddTextDrawable(SceneNode & node)
{
	return node.GetDrawlist().twodim.insert(Drawable());
}