#include <Layout.h>
Public Types | |
enum | Type { LAYOUT_FLOW, LAYOUT_VERTICAL, LAYOUT_ABSOLUTE } |
Public Member Functions | |
virtual Type | getType ()=0 |
Protected Member Functions | |
virtual void | update (const Container *container)=0 |
virtual bool | touchEvent (Touch::TouchEvent evt, int x, int y, unsigned int contactIndex) |
Defines the layout for containers.
Implementations are responsible for positioning, resizing and calling update on all the controls within a container.
Layout types available to containers.
virtual Type gameplay::Layout::getType | ( | ) | [pure virtual] |
Get the type of this layout.
Implemented in gameplay::VerticalLayout, gameplay::FlowLayout, and gameplay::AbsoluteLayout.
virtual bool gameplay::Layout::touchEvent | ( | Touch::TouchEvent | evt, |
int | x, | ||
int | y, | ||
unsigned int | contactIndex | ||
) | [protected, virtual] |
Touch callback on touch events. Coordinates are given relative to the container's content area.
evt | The touch event that occurred. |
x | The x position of the touch in pixels. Left edge is zero. |
y | The y position of the touch in pixels. Top edge is zero. |
contactIndex | The order of occurrence for multiple touch contacts starting at zero. |
virtual void gameplay::Layout::update | ( | const Container * | container | ) | [protected, pure virtual] |
Position, resize, and update the controls within a container.
container | The container to update. |
Implemented in gameplay::VerticalLayout, gameplay::FlowLayout, and gameplay::AbsoluteLayout.