expose card texture for simple text

This commit is contained in:
Cary Sandvig 2000-11-15 20:13:11 +00:00
parent 711bc10e32
commit 765fe789b6
2 changed files with 7 additions and 2 deletions

View File

@ -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();

View File

@ -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);