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

#include <ImageControl.h>

Inheritance diagram for gameplay::ImageControl:
gameplay::Control gameplay::Ref gameplay::AnimationTarget gameplay::ScriptTarget

List of all members.

Public Member Functions

const char * getTypeName () const
void setImage (const char *path)
void setRegionSrc (float x, float y, float width, float height)
void setRegionSrc (const Rectangle &region)
const RectanglegetRegionSrc () const
void setRegionDst (float x, float y, float width, float height)
void setRegionDst (const Rectangle &region)
const RectanglegetRegionDst () const

Static Public Member Functions

static ImageControlcreate (const char *id, Theme::Style *style=NULL)

Protected Member Functions

void initialize (const char *typeName, Theme::Style *style, Properties *properties)
unsigned int drawImages (Form *form, const Rectangle &clip)
void updateBounds ()

Static Protected Member Functions

static Controlcreate (Theme::Style *style, Properties *properties=NULL)

Detailed Description

Defines an image control.

This allows forms to display seperate images from arbitrary files not specified in the theme.

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

Member Function Documentation

static ImageControl* gameplay::ImageControl::create ( const char *  id,
Theme::Style style = NULL 
) [static]

Creates a new ImageControl.

Parameters:
idThe image control ID.
styleThe image control style (optional).
Returns:
The new image control.
static Control* gameplay::ImageControl::create ( Theme::Style style,
Properties properties = NULL 
) [static, protected]

Creates a new ImageControl.

Parameters:
styleThe control's custom style.
propertiesA properties object containing a definition of the ImageControl (optional).
Returns:
The new ImageControl.
unsigned int gameplay::ImageControl::drawImages ( Form form,
const Rectangle clip 
) [protected, virtual]
See also:
Control::drawImages

Reimplemented from gameplay::Control.

Get the destination region of this ImageControl.

Returns:
The destination region of this ImageControl.

Get the source region of this ImageControl.

Returns:
The source region of this ImageControl.
const char* gameplay::ImageControl::getTypeName ( ) const [virtual]

Extends ScriptTarget::getTypeName() to return the type name of this class.

Child controls should override this function to return the correct type name.

Returns:
The type name of this class: "ImageControl"
See also:
ScriptTarget::getTypeName()

Reimplemented from gameplay::Control.

void gameplay::ImageControl::initialize ( const char *  typeName,
Theme::Style style,
Properties properties 
) [protected, virtual]

Initializes the control.

Parameters:
typeNameThe type name of the control being initalized.
styleThe style to apply to this control (optional).
propertiesThe properties to set on this control (optional).

Reimplemented from gameplay::Control.

void gameplay::ImageControl::setImage ( const char *  path)

Set the path of the image for this ImageControl to display.

Parameters:
pathThe path to the image.
void gameplay::ImageControl::setRegionDst ( float  x,
float  y,
float  width,
float  height 
)

Sets the destination region of this ImageControl. This is the region within the control's viewport to draw the image.

Parameters:
xThe x coordinate of the destination region.
yThe y coordinate of the destination region.
widthThe width of the destination region.
heightThe height of the destination region.

Sets the destination region of this ImageControl. This is the region within the control's viewport to draw the image.

Parameters:
regionThe new destination region.
void gameplay::ImageControl::setRegionSrc ( float  x,
float  y,
float  width,
float  height 
)

Set the source region of this ImageControl. This is the region of the file, in pixels, to use when drawing.

Parameters:
xThe x coordinate of the source region.
yThe y coordinate of the source region.
widthThe width of the source region.
heightThe height of the source region.

Set the source region of this ImageControl. This is the region of the file, in pixels, to use when drawing.

Parameters:
regionThe new source region.
void gameplay::ImageControl::updateBounds ( ) [protected, virtual]
See also:
Control::updateBounds

Reimplemented from gameplay::Control.

 All Classes Functions Variables Typedefs Enumerations Enumerator