![]() |
FastEngine 0.9.3
A multiplayer oriented 2D engine made with Vulkan.
|
A GUI element that verify a list of GUI elements. More...
#include <C_guiElement.hpp>
Public Types | |
using | Priority = uint8_t |
Public Member Functions | |
GuiElementArray (fge::GuiElement::Priority priority) | |
void | onGuiVerify (fge::Event const &evt, SDL_EventType evtType, fge::GuiElementContext &context) override |
Function called to verify if the element is hovered by the mouse. | |
bool | isRecursive () const final |
Check if this GuiElement is recursive. | |
void | setGuiScale (fge::Vector2f const &scale) |
Set the scale of the element. | |
fge::Vector2f const & | getGuiScale () const |
Get the scale of the element. | |
void | setPriority (fge::GuiElement::Priority priority) const |
Set the priority of the element. | |
fge::GuiElement::Priority | getPriority () const |
Get the priority of the element. | |
bool | verifyPriority (fge::GuiElement *element) const |
Verify if the priority of the element is higher than the given element. | |
Static Public Member Functions | |
static void | setGlobalGuiScale (fge::Vector2f const &scale) |
static fge::Vector2f const & | getGlobalGuiScale () |
Public Attributes | |
fge::Tunnel< fge::GuiElement > | _elements |
fge::CallbackHandler< fge::Event const &, SDL_MouseWheelEvent const &, fge::GuiElementContext & > | _onGuiMouseWheelScrolled |
Callback called when the element is verified and the mouse wheel is scrolled. | |
fge::CallbackHandler< fge::Event const &, SDL_MouseButtonEvent const &, fge::GuiElementContext & > | _onGuiMouseButtonPressed |
Callback called when the element is verified and the mouse is pressed. | |
fge::CallbackHandler< fge::Event const &, SDL_MouseButtonEvent const &, fge::GuiElementContext & > | _onGuiMouseButtonReleased |
Callback called when the element is verified and a mouse button is released. | |
fge::CallbackHandler< fge::Event const &, SDL_MouseMotionEvent const &, fge::GuiElementContext & > | _onGuiMouseMoved |
Callback called when the element is verified and the mouse is moved. | |
Static Public Attributes | |
static fge::CallbackHandler< fge::Vector2f const & > | _onGlobalGuiScaleChange |
Protected Member Functions | |
void | verifyRecursively (fge::Event const &evt, SDL_EventType evtType, fge::GuiElementContext &context) const |
Protected Attributes | |
fge::GuiElement::Priority | _g_priority { 50 } |
fge::Vector2f | _g_scale {1.0f, 1.0f} |
A GUI element that verify a list of GUI elements.
|
inlinenodiscardinherited |
Get the scale of the element.
|
inlinenodiscardinherited |
Get the priority of the element.
|
inlinefinalvirtualinherited |
Check if this GuiElement is recursive.
A gui element is recursive if it handle others GuiElements.
Reimplemented from fge::GuiElement.
|
inlineoverridevirtual |
Function called to verify if the element is hovered by the mouse.
This function should call verifyPriority to verify the priority of the element. If the priority is higher than the given element, the function should replace the provided pointer reference element with the element itself.
evt | An fge::Event |
evtType | The type of the SDL event called |
context | The GuiElement context |
Implements fge::GuiElement.
|
inlineinherited |
Set the scale of the element.
scale | The scale of the element |
|
inlineinherited |
Set the priority of the element.
The priority value can be used with the scene DepthPlan.
priority | The priority of the element |
|
inlinenodiscardinherited |
Verify if the priority of the element is higher than the given element.
If the provided element is null, the function will assume that the element is the highest priority.
element | The element to compare with |
|
inherited |
Callback called when the element is verified and the mouse is pressed.
|
inherited |
Callback called when the element is verified and a mouse button is released.
|
inherited |
Callback called when the element is verified and the mouse is moved.
|
inherited |
Callback called when the element is verified and the mouse wheel is scrolled.