JNGL
Easy to use cross-platform 2D game library
Loading...
Searching...
No Matches
Public Member Functions | List of all members
Container Class Reference

Helper class to handle multiple instances of Widget. More...

#include <jngl/Container.hpp>

Public Member Functions

void step ()
 Calls Widget::step of every widget and removes the once which request it.
 
void draw () const
 Calls Widget::draw of every widget.
 
WidgetaddWidget (std::unique_ptr< Widget >)
 Adds a Widget to the container (safe to call during Container::step)
 
template<class T , class... Args>
T * addWidget (Args &&... args)
 The same as addWidget(std::unique_ptr<Widget>) but creates the Widget for you.
 
void removeWidget (Widget *)
 Removes a Widget from the Container (safe to call during Container::step)
 

Detailed Description

Helper class to handle multiple instances of Widget.

Definition at line 16 of file Container.hpp.

Member Function Documentation

◆ addWidget()

template<class T , class... Args>
T * addWidget ( Args &&... args)
inline

The same as addWidget(std::unique_ptr<Widget>) but creates the Widget for you.

Definition at line 28 of file Container.hpp.


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