mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-08 12:31:51 +00:00
idk
This commit is contained in:
parent
b4caf888dc
commit
c9db1acd91
6 changed files with 227 additions and 221 deletions
|
|
@ -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);
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue