UIButton* UI::addButton(int id, int x, int y, int width, int height, uint32_t textureID_idle, uint32_t textureID_hover, uint32_t textureID_press, const char* text, void (*callback)(UINode* Sender), UINode* parent) { UIButton* button; if(parent==NULL) button = new UIButton(mRootNode); else button = new UIButton(parent); button->nodeID = id; button->textureID_idle = textureID_idle; button->textureID_hover = textureID_hover; button->textureID_press = textureID_press; button->setPos(x, y); button->setText(text); button->setSize(width, height); button->setCallback(callback); nodeList.push_back(button); return button; }