mirror of
https://github.com/panda3d/panda3d.git
synced 2025-09-29 16:20:11 -04:00
expose card texture for simple text
This commit is contained in:
parent
711bc10e32
commit
765fe789b6
@ -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();
|
||||
|
@ -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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user