This repository has been archived by the owner on Apr 10, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #91 dev -> master, Added custom fonts support, GUI…
… enchantments dev -> master, Added custom fonts support, GUI enchantments
- Loading branch information
Showing
9 changed files
with
91 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,45 @@ | ||
#include <core/GUI/GUI.h> | ||
#include <Magnum/ImGuiIntegration/Integration.h> | ||
#include <misc/cpp/imgui_stdlib.h> | ||
#include <limits> | ||
|
||
namespace core { | ||
|
||
bool GUI::Button(const string &label, Vector2 size) { | ||
// TODO: PushID | ||
bool GUI::Button(const string& label, Vector2 size) { | ||
return ImGui::Button(label.c_str(), ImVec2(size)); | ||
} | ||
bool GUI::CheckBox(const string& label, bool* value) { | ||
// TODO: PushID | ||
return ImGui::Checkbox(label.c_str(), value); | ||
bool GUI::CheckBox(const string& label, bool& value) { | ||
ImGui::PushID(value); | ||
bool out = ImGui::Checkbox(label.c_str(), &value); | ||
ImGui::PopID(); | ||
return out; | ||
} | ||
void GUI::Text(const string &text) { | ||
// TODO: PushID | ||
ImGui::Text(text.c_str()); | ||
void GUI::Text(const string& text) { | ||
return ImGui::Text("%s", text.c_str()); | ||
} | ||
bool GUI::IsHovered() { | ||
return ImGui::IsItemHovered(); | ||
} | ||
bool GUI::IsActive() { | ||
return ImGui::IsItemActive(); | ||
} | ||
bool GUI::IsFocused() { | ||
return ImGui::IsItemFocused(); | ||
} | ||
void GUI::Tooltip(const string& text) { | ||
ImGui::SetTooltip("%s", text.c_str()); | ||
} | ||
void GUI::TextLabel(const string& text, const string& label) { | ||
ImGui::LabelText(label.c_str(), text.c_str()); | ||
} | ||
bool GUI::Box(bool& isOpen) { | ||
ImGui::PushID(isOpen); | ||
bool out = ImGui::BeginChild("Box", { 0, 0 }, false, ImGuiWindowFlags_NoTitleBar | ImGuiWindowFlags_NoCollapse ); | ||
return out; | ||
} | ||
void GUI::EndBox() { | ||
ImGui::EndChild(); | ||
ImGui::PopID(); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters