![]() |
xyginext
0.2.0
Second generation of xygine game creation framework
|
Utility functions which act as ImGui wrappers. These are for a convenience, however it is possible to use ImGui directly if preferred. Immediate mode ui information is rendered to the status window via GuiClient::registerTabControl(). More...
Classes | |
struct | Style |
Functions | |
XY_EXPORT_API void | begin (const std::string &title, bool *open=nullptr) |
XY_EXPORT_API void | setNextWindowSize (float x, float y) |
XY_EXPORT_API void | setNextWindowConstraints (float minW, float minY, float maxW, float maxY) |
XY_EXPORT_API void | setNextWindowPosition (float x, float y) |
Set the next window position in window coordinates. More... | |
XY_EXPORT_API void | text (const std::string &str) |
XY_EXPORT_API bool | button (const std::string &label, float w=0.f, float h=0.f) |
XY_EXPORT_API void | checkbox (const std::string &title, bool *value) |
XY_EXPORT_API void | slider (const std::string &title, float &value, float min, float max, float itemWidth=200.f) |
XY_EXPORT_API void | separator () |
XY_EXPORT_API void | sameLine (float posX=0.f, float spacing=-1.f) |
XY_EXPORT_API bool | simpleCombo (const std::string &title, std::int32_t &index, const char *items, float itemWidth=200.f) |
Simple combo box. More... | |
XY_EXPORT_API bool | input (const std::string &label, std::int32_t &value, float itemWidth=200.f) |
XY_EXPORT_API bool | radioButton (const std::string &title, std::int32_t &output, std::int32_t value) |
XY_EXPORT_API void | showToolTip (const std::string &message) |
Displays a tool tip when the previously drawn item is hovered. More... | |
XY_EXPORT_API bool | colourPicker (const std::string &label, sf::Color &output) |
Displays an RGBA colour picker and places the result in output. More... | |
XY_EXPORT_API bool | beginMenuBar () |
XY_EXPORT_API void | endMenuBar () |
XY_EXPORT_API bool | beginMenu (const std::string &title) |
XY_EXPORT_API void | endMenu () |
XY_EXPORT_API bool | menuItem (const std::string &title, bool &selected) |
XY_EXPORT_API void | image (const sf::Texture &texture, sf::Color tint=sf::Color::White, sf::Color border=sf::Color::Black) |
Draws an image using the given texture. More... | |
XY_EXPORT_API void | end () |
XY_EXPORT_API bool | wantsMouse () |
XY_EXPORT_API bool | wantsKeyboard () |
XY_EXPORT_API const Style & | getStyle () |
Get the current style. | |
XY_EXPORT_API void | setStyle (const Style &style) |
Set the current style. | |
Utility functions which act as ImGui wrappers. These are for a convenience, however it is possible to use ImGui directly if preferred. Immediate mode ui information is rendered to the status window via GuiClient::registerTabControl().
XY_EXPORT_API void xy::ui::begin | ( | const std::string & | title, |
bool * | open = nullptr |
||
) |
XY_EXPORT_API bool xy::ui::beginMenu | ( | const std::string & | title | ) |
XY_EXPORT_API bool xy::ui::beginMenuBar | ( | ) |
XY_EXPORT_API bool xy::ui::button | ( | const std::string & | label, |
float | w = 0.f , |
||
float | h = 0.f |
||
) |
XY_EXPORT_API void xy::ui::checkbox | ( | const std::string & | title, |
bool * | value | ||
) |
XY_EXPORT_API bool xy::ui::colourPicker | ( | const std::string & | label, |
sf::Color & | output | ||
) |
Displays an RGBA colour picker and places the result in output.
output | Reference to an sf::Colour in which to store the result |
XY_EXPORT_API void xy::ui::end | ( | ) |
XY_EXPORT_API void xy::ui::endMenu | ( | ) |
XY_EXPORT_API void xy::ui::endMenuBar | ( | ) |
XY_EXPORT_API void xy::ui::image | ( | const sf::Texture & | texture, |
sf::Color | tint = sf::Color::White , |
||
sf::Color | border = sf::Color::Black |
||
) |
Draws an image using the given texture.
texture | Texture to use when drawing the image |
tint | Colour to multiply with the texture when drawing |
border | Colour to use when drawing the border |
XY_EXPORT_API bool xy::ui::input | ( | const std::string & | label, |
std::int32_t & | value, | ||
float | itemWidth = 200.f |
||
) |
XY_EXPORT_API bool xy::ui::menuItem | ( | const std::string & | title, |
bool & | selected | ||
) |
XY_EXPORT_API bool xy::ui::radioButton | ( | const std::string & | title, |
std::int32_t & | output, | ||
std::int32_t | value | ||
) |
title | String containing title of the radio button |
output | Reference to an integer to hold the value of the selected radio button |
value | The value of the radio button which will be placed in output when the radio button is selected |
XY_EXPORT_API void xy::ui::sameLine | ( | float | posX = 0.f , |
float | spacing = -1.f |
||
) |
XY_EXPORT_API void xy::ui::separator | ( | ) |
XY_EXPORT_API void xy::ui::setNextWindowConstraints | ( | float | minW, |
float | minY, | ||
float | maxW, | ||
float | maxY | ||
) |
XY_EXPORT_API void xy::ui::setNextWindowPosition | ( | float | x, |
float | y | ||
) |
Set the next window position in window coordinates.
XY_EXPORT_API void xy::ui::setNextWindowSize | ( | float | x, |
float | y | ||
) |
XY_EXPORT_API void xy::ui::showToolTip | ( | const std::string & | message | ) |
Displays a tool tip when the previously drawn item is hovered.
message | String containing the message to display |
XY_EXPORT_API bool xy::ui::simpleCombo | ( | const std::string & | title, |
std::int32_t & | index, | ||
const char * | items, | ||
float | itemWidth = 200.f |
||
) |
Simple combo box.
name | String containing the label of the combobox |
index | Reference to the integer variable which holds the selected index |
items | A string containing a null delimited list of items eg "item01\0item02\0item the third\0\0" |
XY_EXPORT_API void xy::ui::slider | ( | const std::string & | title, |
float & | value, | ||
float | min, | ||
float | max, | ||
float | itemWidth = 200.f |
||
) |
XY_EXPORT_API void xy::ui::text | ( | const std::string & | str | ) |
XY_EXPORT_API bool xy::ui::wantsKeyboard | ( | ) |
XY_EXPORT_API bool xy::ui::wantsMouse | ( | ) |