|  | overview |  | wiki |  | api reference |  | download

- Main Page
- Classes

- Class List
- Class Index
- Class Hierarchy
- Class Members

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:

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 Rectangle & | getRegionSrc () const
void | setRegionDst (float x, float y, float width, float height)
void | setRegionDst (const Rectangle &region)
const Rectangle & | getRegionDst () const

## Static Public Member Functions

static ImageControl * | create (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 Control * | create (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:

  id | The image control ID.
  style | The 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:

  style | The control's custom style.
  properties | A 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.

const Rectangle& gameplay::ImageControl::getRegionDst | ( |  | ) | const

Get the destination region of this ImageControl.

Returns:
  The destination region of this ImageControl.

const Rectangle& gameplay::ImageControl::getRegionSrc | ( |  | ) | const

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:

  typeName | The type name of the control being initalized.
  style | The style to apply to this control (optional).
  properties | The 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:

  path | The 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:

  x | The x coordinate of the destination region.
  y | The y coordinate of the destination region.
  width | The width of the destination region.
  height | The height of the destination region.

void gameplay::ImageControl::setRegionDst | ( | const Rectangle & | region | ) |

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

Parameters:

  region | The 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:

  x | The x coordinate of the source region.
  y | The y coordinate of the source region.
  width | The width of the source region.
  height | The height of the source region.

void gameplay::ImageControl::setRegionSrc | ( | const Rectangle & | region | ) |

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

Parameters:

  region | The new source region.

void gameplay::ImageControl::updateBounds | ( |  | ) | `[protected, virtual]`

See also:
  Control::updateBounds

Reimplemented from gameplay::Control.

All Classes Functions Variables Typedefs Enumerations Enumerator