#include <events.h>
Public Member Functions | |
| void | runGame () |
| void | addView (UIElement *ui) |
| UIElement * | focusedView () const |
| Graphics::Screen * | getScreen () const |
| void | drawElements () |
| void | draw () override |
| bool | tick () override |
Public Member Functions inherited from Macs2::UIElement | |
| UIElement (const Common::String &name, UIElement *uiParent) | |
| UIElement (const Common::String &name) | |
| void | redraw () |
| Graphics::ManagedSurface | getSurface () const |
| virtual UIElement * | findView (const Common::String &name) |
Public Attributes | |
| uint32 | currentMillis = 0 |
Protected Member Functions | |
| void | processEvent (Common::Event &ev) |
| virtual bool | shouldQuit () const =0 |
| bool | msgAction (const ActionMessage &e) override |
| bool | msgFocus (const FocusMessage &e) override |
| bool | msgUnfocus (const UnfocusMessage &e) override |
| bool | msgKeypress (const KeypressMessage &e) override |
| bool | msgMouseDown (const MouseDownMessage &e) override |
| bool | msgMouseUp (const MouseUpMessage &e) override |
Protected Member Functions inherited from Macs2::UIElement | |
| virtual bool | msgMouseMove (const MouseMoveMessage &e) |
Additional Inherited Members | |
Protected Attributes inherited from Macs2::UIElement | |
| Common::Array< UIElement * > | _children |
| Common::Rect | _innerBounds |
| Bounds | _bounds |
| bool | _needsRedraw = true |
| Common::String | _name |
Main events and view manager. This is kept separate from the engine class because the engine may add a lot of globals and bring in other classes. So to save on compilation time, classes that only need to access basic view management methods like addView only need to include events.h rather than the whole engine.
|
protected |
Process an event
|
protectedpure virtual |
Returns true if the game should quit
Implemented in Macs2::Macs2Engine.
| void Macs2::Events::runGame | ( | ) |
Main game loop
| void Macs2::Events::addView | ( | UIElement * | ui | ) |
Adds a focused view to the view stack without replacing current one
|
inline |
Returns the currently focused view, if any
|
inline |
Returns the underlying screen
|
inline |
Draws the focused view
|
inlineoverridevirtual |
Events manager doesn't have any intrinsic drawing
Reimplemented from Macs2::UIElement.
|
inlineoverridevirtual |
Called once every game frame
Reimplemented from Macs2::UIElement.
Reimplemented in Macs2::Macs2Engine.