diff --git a/panda/src/gui/guiLabel.cxx b/panda/src/gui/guiLabel.cxx index a974e7de15..a374b733a7 100644 --- a/panda/src/gui/guiLabel.cxx +++ b/panda/src/gui/guiLabel.cxx @@ -138,15 +138,19 @@ GuiLabel* GuiLabel::make_simple_texture_label(Texture* texture) { return ret; } -GuiLabel* GuiLabel::make_simple_text_label(const string& text, Node* font) { +GuiLabel* GuiLabel::make_simple_text_label(const string& text, Node* font, + Texture* tex) { GuiLabel* ret = new GuiLabel(); ret->_type = SIMPLE_TEXT; TextNode* n = new TextNode("GUI label"); ret->_geom = n; + ret->_tex = tex; n->set_font(font); n->set_align(TM_ALIGN_CENTER); n->set_text_color(ret->get_foreground_color()); n->set_text(text); + if (tex != (Texture*)0L) + n->set_card_texture(tex); ret->set_scale(1.); ret->set_pos(LVector3f(0., 0., 0.)); ret->recompute_transform(); diff --git a/panda/src/gui/guiLabel.h b/panda/src/gui/guiLabel.h index 3db87f9b33..2d7b842868 100644 --- a/panda/src/gui/guiLabel.h +++ b/panda/src/gui/guiLabel.h @@ -51,7 +51,8 @@ public: virtual ~GuiLabel(void); static GuiLabel* make_simple_texture_label(Texture*); - static GuiLabel* make_simple_text_label(const string&, Node*); + static GuiLabel* make_simple_text_label(const string&, Node*, + Texture* = (Texture*)0L); void get_extents(float&, float&, float&, float&); float get_width(void);