void AiCarStandard::ConfigureDrawable(SceneNode::DrawableHandle & ref, SceneNode & topnode, float r, float g, float b) { if (!ref.valid()) { ref = topnode.GetDrawList().normal_noblend.insert(Drawable()); Drawable & d = topnode.GetDrawList().normal_noblend.get(ref); d.SetColor(r,g,b,1); d.SetDecal(true); } }
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); }
static void EraseTextDrawable(SceneNode & node, SceneNode::DrawableHandle & drawhandle) { if (drawhandle.valid()) { node.GetDrawList().twodim.erase(drawhandle); drawhandle.invalidate(); } }
void GuiLabel::SetupDrawable( SceneNode & scene, const Font & font, int align, float scalex, float scaley, float xywh[4], float z) { m_font = &font; m_x = xywh[0]; m_y = xywh[1]; m_w = xywh[2]; m_h = xywh[3]; m_scalex = scalex; m_scaley = scaley; m_align = align; m_draw = scene.GetDrawList().text.insert(Drawable()); Drawable & drawref = GetDrawable(scene); drawref.SetDrawOrder(z); m_text_draw.Set(drawref, font, m_text, m_x, m_y, scalex, scaley, m_rgb[0], m_rgb[1], m_rgb[2]); }
static SceneNode::DrawableHandle AddTextDrawable(SceneNode & node) { return node.GetDrawList().twodim.insert(Drawable()); }