JNGL
Easy to use cross-platform 2D game library
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Protected Attributes | List of all members
Widget Class Referenceabstract

Public Types

enum class  Action : uint8_t { NONE , REMOVE , REQUEST_FOCUS }
 

Public Member Functions

 Widget (jngl::Vec2 position)
 Creates a Widget centered at position.
 
virtual Action step ()
 Steps all Effects.
 
virtual void draw () const
 Draws the widget with all effects applied.
 
virtual void drawSelf (Mat3 modelview) const =0
 Override this function to draw the widget.
 
void addEffect (std::unique_ptr< Effect >)
 
template<class T , class... Args>
void addEffect (Args &&... args)
 
void removeEffect (Effect *)
 
virtual void removeEffects ()
 Removes all effects.
 
jngl::Vec2 getPosition () const
 Returns the center.
 

Protected Attributes

jngl::Vec2 position
 Center.
 

Detailed Description

Definition at line 18 of file Widget.hpp.

Inheritance diagram for Widget:
[legend]
Collaboration diagram for Widget:
[legend]

Member Enumeration Documentation

◆ Action

enum class Action : uint8_t
strong

Definition at line 25 of file Widget.hpp.

Member Function Documentation

◆ step()

virtual Action step ( )
virtual

Steps all Effects.

When Action::REMOVE is returned, the Widget wants to be removed from its container.

◆ drawSelf()

virtual void drawSelf ( Mat3 modelview) const
pure virtual

Override this function to draw the widget.

Implemented in Label.

◆ addEffect()

template<class T , class... Args>
void addEffect ( Args &&... args)
inline

Definition at line 45 of file Widget.hpp.

Member Data Documentation

◆ position

jngl::Vec2 position
protected

Center.

Definition at line 59 of file Widget.hpp.


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