Gamedev Framework (gf)
0.3.0
A C++11 framework for 2D games
|
A container of views. More...
#include <gf/ViewContainer.h>
Public Member Functions | |
void | addView (AdaptativeView &view) |
Add a view to the container. More... | |
void | processEvent (const Event &event) |
Update the views thanks to the event. More... | |
void | onScreenResize (Vector2u screenSize) |
Update the views with the new screen size. More... | |
void | setInitialScreenSize (Vector2u screenSize) |
Set the initial screen size. More... | |
A container of views.
A view manager handles several adaptive views. It can update all the views at the same time. All it needs is the events that come from the window.
Here is a full example with two adaptive views:
void gf::ViewContainer::addView | ( | AdaptativeView & | view | ) |
Add a view to the container.
view | An adaptive view |
void gf::ViewContainer::onScreenResize | ( | Vector2u | screenSize | ) |
Update the views with the new screen size.
screenSize | The new size of the screen |
void gf::ViewContainer::processEvent | ( | const Event & | event | ) |
Update the views thanks to the event.
Internally it calls onScreenResize() if a resize event occurs.
event | An event |
void gf::ViewContainer::setInitialScreenSize | ( | Vector2u | screenSize | ) |
Set the initial screen size.
screenSize | The initial size of the screen |