overview wiki api reference download
 All Classes Functions Variables Typedefs Enumerations Enumerator
Public Types | Public Member Functions | Protected Member Functions
gameplay::Layout Class Reference

#include <Layout.h>

Inheritance diagram for gameplay::Layout:
gameplay::Ref gameplay::AbsoluteLayout gameplay::FlowLayout gameplay::VerticalLayout

List of all members.

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)

Detailed Description

Defines the layout for containers.

Implementations are responsible for positioning, resizing and calling update on all the controls within a container.

See also:
http://gameplay3d.github.io/GamePlay/docs/file-formats.html#wiki-UI_Forms

Member Enumeration Documentation

Layout types available to containers.

Enumerator:
LAYOUT_FLOW 

Flow layout: Controls are placed next to one another horizontally until the right-most edge of the container is reached, at which point a new row is started.

LAYOUT_VERTICAL 

Vertical layout: Controls are placed next to one another vertically until the bottom-most edge of the container is reached.

LAYOUT_ABSOLUTE 

Absolute layout: Controls are not modified at all by this layout. They must be positioned and sized manually.


Member Function Documentation

virtual Type gameplay::Layout::getType ( ) [pure virtual]

Get the type of this layout.

Returns:
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.

Parameters:
evtThe touch event that occurred.
xThe x position of the touch in pixels. Left edge is zero.
yThe y position of the touch in pixels. Top edge is zero.
contactIndexThe order of occurrence for multiple touch contacts starting at zero.
See also:
Touch::TouchEvent
virtual void gameplay::Layout::update ( const Container container) [protected, pure virtual]

Position, resize, and update the controls within a container.

Parameters:
containerThe container to update.

Implemented in gameplay::VerticalLayout, gameplay::FlowLayout, and gameplay::AbsoluteLayout.

 All Classes Functions Variables Typedefs Enumerations Enumerator