Wrath of Zeus
Made by Torchlight Games for CSE 125 SP24
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Static Public Member Functions
gui::widget::Empty Class Reference

#include <empty.hpp>

Inheritance diagram for gui::widget::Empty:
gui::widget::Widget

Public Types

using Ptr = std::unique_ptr< Empty >
 
- Public Types inherited from gui::widget::Widget
using Ptr = std::unique_ptr< Widget >
 

Public Member Functions

 Empty (glm::vec2 origin, glm::vec2 size)
 
 Empty (glm::vec2 size)
 
 Empty (float width, float height)
 
 Empty (float width)
 
void render () override
 ====================================================================================== More...
 
- Public Member Functions inherited from gui::widget::Widget
 Widget (Type type, glm::vec2 origin)
 Sets the type and origin position of the widget, and assigns a new unique handle. More...
 
virtual ~Widget ()=default
 
void setOrigin (glm::vec2 origin)
 Overrides the current origin position with the newly specified one. More...
 
virtual void lock ()
 Function that is run after all of the widgets have been added to the screee but before any input handling has occurred. More...
 
CallbackHandle addOnClick (Callback callback)
 ====================================================================================== More...
 
CallbackHandle addOnHover (Callback callback)
 Register a new onHover callback function for this widget. More...
 
void removeOnClick (CallbackHandle handle)
 Removes the onClick callback function associated with the given handle. More...
 
void removeOnHover (CallbackHandle handle)
 Removes the onHover callback function associated with the given handle. More...
 
virtual void doClick (float x, float y)
 Performs a click at the specified (x,y) position in the GUI coordinate frame. More...
 
virtual void doHover (float x, float y)
 Performs a hover action at the specified (x,y) position in the GUI coordinate frame. More...
 
virtual void render ()=0
 ====================================================================================== More...
 
Type getType () const
 ====================================================================================== More...
 
const glm::vec2 & getOrigin () const
 Queries the origin position of the widget. More...
 
std::pair< std::size_t, std::size_t > getSize () const
 Queries the size of the widget in pixels. More...
 
Handle getHandle () const
 Queries the handle for this specific widget. More...
 
virtual bool hasHandle (Handle handle) const
 ====================================================================================== More...
 
virtual Widgetborrow (Handle handle)
 Gives a pointer to the subwidget specified by the handle. More...
 

Static Public Member Functions

template<typename... Params>
static Ptr make (Params &&... params)
 

Additional Inherited Members

- Protected Attributes inherited from gui::widget::Widget
Handle handle
 ====================================================================================== More...
 
Type type
 Type of the widget. More...
 
glm::vec2 origin
 Origin position (bottom left) of the widget in GUI coordinates. More...
 
std::size_t width {0}
 Width of the widget, in pixels. More...
 
std::size_t height {0}
 Height of the widget, in pixels. More...
 
std::unordered_map< CallbackHandle, Callbackon_clicks
 all of the onClick handlers, indexable by handle More...
 
std::unordered_map< CallbackHandle, Callbackon_hovers
 all of the onHover handlers, indexable by handle More...
 
- Static Protected Attributes inherited from gui::widget::Widget
static std::size_t num_widgets = 0
 Static counter for the number of widgets that have been created, so a new identifier can be assigned to each widget as they are created. More...
 

Member Typedef Documentation

◆ Ptr

using gui::widget::Empty::Ptr = std::unique_ptr<Empty>

Constructor & Destructor Documentation

◆ Empty() [1/4]

gui::widget::Empty::Empty ( glm::vec2  origin,
glm::vec2  size 
)

◆ Empty() [2/4]

gui::widget::Empty::Empty ( glm::vec2  size)
inlineexplicit

◆ Empty() [3/4]

gui::widget::Empty::Empty ( float  width,
float  height 
)
inline

◆ Empty() [4/4]

gui::widget::Empty::Empty ( float  width)
inlineexplicit

Member Function Documentation

◆ make()

template<typename... Params>
static Ptr gui::widget::Empty::make ( Params &&...  params)
inlinestatic

◆ render()

void gui::widget::Empty::render ( )
overridevirtual

======================================================================================

=<DISPLAY>============================================================================

Renders the widget to the screen

This is the only function that must be overridden by derived classes.

Implements gui::widget::Widget.


The documentation for this class was generated from the following files: