mirror of
https://github.com/devZoGok/vb01.git
synced 2026-08-26 19:43:30 +00:00
GUI utilities
This commit is contained in:
@@ -154,6 +154,14 @@ namespace vb01Gui{
|
||||
textboxes.push_back(t);
|
||||
}
|
||||
|
||||
Button* AbstractGuiManager::getButton(string name){
|
||||
for(Button *b : buttons)
|
||||
if(b->getName() == name)
|
||||
return b;
|
||||
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
void AbstractGuiManager::removeButton(Button *b) {
|
||||
for (int i = 0; i < buttons.size(); i++) {
|
||||
if (b == buttons[i]) {
|
||||
|
||||
@@ -22,6 +22,7 @@ namespace vb01Gui{
|
||||
std::vector<Button*> findClickedButtons();
|
||||
void updateGui();
|
||||
void addButton(Button *b){buttons.push_back(b);}
|
||||
Button* getButton(std::string);
|
||||
void removeButton(Button*);
|
||||
void removeButton(std::string);
|
||||
void addListbox(Listbox*);
|
||||
|
||||
+1
-1
@@ -46,7 +46,7 @@ namespace vb01Gui{
|
||||
rectNode->attachMesh(rect);
|
||||
guiNode->attachChild(rectNode);
|
||||
|
||||
if(separate){
|
||||
if(separate && fontPath != ""){
|
||||
text = new Text(fontPath, stringToWstring(name));
|
||||
|
||||
float sc = .2;
|
||||
|
||||
@@ -24,18 +24,19 @@ namespace vb01Gui{
|
||||
virtual void onMouseOver();
|
||||
virtual void onMouseOff();
|
||||
virtual void onClick(){}
|
||||
inline vb01::Vector3 getPos(){return pos;}
|
||||
void setPos(vb01::Vector3);
|
||||
inline vb01::Vector2 getSize(){return size;}
|
||||
void setSize(vb01::Vector2);
|
||||
void setColor(vb01::Vector4);
|
||||
void setImage(std::string);
|
||||
inline vb01::Node* getRectNode(){return rectNode;}
|
||||
inline vb01::Vector3 getPos(){return pos;}
|
||||
inline vb01::Vector2 getSize(){return size;}
|
||||
inline std::string getName(){return name;}
|
||||
inline void setActive(bool active){this->active = active;}
|
||||
inline bool isSeparate(){return separate;}
|
||||
inline bool isActive(){return active;}
|
||||
inline vb01::Vector4 getColor(){return color;}
|
||||
inline int getTrigger(){return trigger;}
|
||||
void setColor(vb01::Vector4);
|
||||
void setImage(std::string);
|
||||
protected:
|
||||
int trigger, initWindowSize[2];
|
||||
bool separate, active = true, mouseOver = false;
|
||||
|
||||
Reference in New Issue
Block a user