idk
This commit is contained in:
@@ -64,7 +64,9 @@ Button::Button(shared_ptr<UINode> content, glm::vec4 padding) : Panel(vec2(32,32
|
||||
scrollable(false);
|
||||
}
|
||||
|
||||
Button::Button(wstring text, glm::vec4 padding) : Panel(vec2(32,32), padding, 0) {
|
||||
Button::Button(wstring text, glm::vec4 padding, glm::vec4 margin)
|
||||
: Panel(vec2(32,32), padding, 0) {
|
||||
this->margin(margin);
|
||||
Label* label = new Label(text);
|
||||
label->align(Align::center);
|
||||
this->label = shared_ptr<UINode>(label);
|
||||
|
||||
@@ -48,7 +48,9 @@ namespace gui {
|
||||
std::shared_ptr<UINode> label = nullptr;
|
||||
public:
|
||||
Button(std::shared_ptr<UINode> content, glm::vec4 padding=glm::vec4(2.0f));
|
||||
Button(std::wstring text, glm::vec4 padding=glm::vec4(2.0f));
|
||||
Button(std::wstring text,
|
||||
glm::vec4 padding=glm::vec4(2.0f),
|
||||
glm::vec4 margin=glm::vec4(1.0f));
|
||||
|
||||
virtual void drawBackground(Batch2D* batch, Assets* assets);
|
||||
|
||||
|
||||
@@ -19,6 +19,7 @@ Button* guiutil::backButton(PagesControl* menu) {
|
||||
}
|
||||
|
||||
Button* guiutil::gotoButton(wstring text, string page, PagesControl* menu) {
|
||||
text = langs::get(text, L"menu");
|
||||
return (new Button(text, vec4(10.f)))->listenAction([=](GUI* gui) {
|
||||
menu->set(page);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user