![]() |
Gamedev Framework (gf) 1.2.0
A C++17 framework for 2D games
|
A collection of widgets. More...
#include <gf/WidgetContainer.h>
Public Member Functions | |
WidgetContainer () | |
Construct a widget wontainer with a given view. More... | |
void | render (RenderTarget &target, const RenderStates &states=RenderStates()) |
Render the widgets on the target. More... | |
void | pointTo (Vector2f coords) |
Check if the given coords are hover a widget and set it selected if so. More... | |
void | addWidget (Widget &widget) |
Add a widget to the list of widgets. More... | |
Widget * | removeWidget (Widget *widget) |
Remove a widget from the list. More... | |
void | triggerAction () |
Trigger the callback of the current selected widget. More... | |
void | selectNextWidget () |
Select the next widget in the list as the current selected widget. More... | |
void | selectPreviousWidget () |
Select the previous widget in the list as the current selected widget. More... | |
void | clear () |
Remove all widgets. More... | |
A collection of widgets.
gf::WidgetContainer::WidgetContainer | ( | ) |
Construct a widget wontainer with a given view.
void gf::WidgetContainer::addWidget | ( | Widget & | widget | ) |
Add a widget to the list of widgets.
widget | A widget to add to the list |
void gf::WidgetContainer::clear | ( | ) |
Remove all widgets.
void gf::WidgetContainer::pointTo | ( | Vector2f | coords | ) |
Check if the given coords are hover a widget and set it selected if so.
coords | The coords to check |
Remove a widget from the list.
widget | The widget to remove |
nullptr
if the widget was not present void gf::WidgetContainer::render | ( | RenderTarget & | target, |
const RenderStates & | states = RenderStates() |
||
) |
Render the widgets on the target.
Widgets are rendered by the order they appears on the list.
target | The render target |
states | The render states to use for drawing |
void gf::WidgetContainer::selectNextWidget | ( | ) |
Select the next widget in the list as the current selected widget.
void gf::WidgetContainer::selectPreviousWidget | ( | ) |
Select the previous widget in the list as the current selected widget.
void gf::WidgetContainer::triggerAction | ( | ) |
Trigger the callback of the current selected widget.