Forráskód Böngészése

look, it even works

Cary Sandvig 25 éve
szülő
commit
363f579d14
2 módosított fájl, 10 hozzáadás és 0 törlés
  1. 9 0
      panda/src/gui/guiBackground.cxx
  2. 1 0
      panda/src/gui/guiBackground.h

+ 9 - 0
panda/src/gui/guiBackground.cxx

@@ -42,6 +42,15 @@ GuiBackground::GuiBackground(const string& name, GuiItem* item, Texture* tex)
   item->set_priority(_bg, P_High);
 }
 
+GuiBackground::GuiBackground(const string& name, GuiItem* item, GuiLabel* l)
+  : GuiItem(name), _bg(l), _item(item) {
+  _bg->set_width(_item->get_width());
+  _bg->set_height(_item->get_height());
+  _bg->set_pos(LVector3f::rfu((_item->get_left() + _item->get_right())*0.5, 0.,
+			      (_item->get_bottom() + _item->get_top())*0.5));
+  item->set_priority(_bg, P_High);
+}
+
 GuiBackground::~GuiBackground(void) {
   this->unmanage();
 }

+ 1 - 0
panda/src/gui/guiBackground.h

@@ -19,6 +19,7 @@ private:
 PUBLISHED:
   GuiBackground(const string&, GuiItem*);
   GuiBackground(const string&, GuiItem*, Texture*);
+  GuiBackground(const string&, GuiItem*, GuiLabel*);
   ~GuiBackground(void);
 
   virtual void manage(GuiManager*, EventHandler&);