# CEGUI::RenderableImage Class Reference

A higher order GUI entity that represents a renderable image with formatting options. More...

Collaboration diagram for CEGUI::RenderableImage:

[legend]
List of all members.

## Public Types

enum | HorzFormatting { LeftAligned, RightAligned, HorzCentred, HorzStretched, HorzTiled }
| Enumeration of horizontal formatting options for a RenderableImage. More...
enum | VertFormatting { TopAligned, BottomAligned, VertCentred, VertStretched, VertTiled }
| Enumeration of vertical formatting options for a RenderableImage. More...

## Public Member Functions

| RenderableImage (void)
| Default constructor for RenderableImage objects.
virtual | ~RenderableImage (void)
| Destructor for RenderableImage objects.
void | setImage (const Image *image)
| Set the Image object to be drawn by this RenderableImage.
void | setHorzFormatting (HorzFormatting formatting)
| Set the required horizontal formatting.
void | setVertFormatting (VertFormatting formatting)
| Set the required vertical formatting.
void | setQuadSplitMode (QuadSplitMode split_mode)
| Set the required quad split mode.
const Image * | getImage (void) const
| Return the Image object currently set to be rendered.
HorzFormatting | getHorzFormatting (void) const
| Return current horizontal formatting setting.
VertFormatting | getVertFormatting (void) const
| Return current vertical formatting setting.
QuadSplitMode | getQuadSplitMode (void) const
| Return current quad split mode setting.

## Protected Member Functions

void | draw_impl (const Vector3 &position, const Rect &clip_rect) const
| Renders the imagery for a RenderableImage element.
void | draw_impl (RenderCache &renderCache) const
uint | getHorzTileCount () const
| return number of horizontal tiles required.
uint | getVertTileCount () const
| return number of vertical tiles required.
float | getBaseXCoord (const Size &sz) const
| Return base x co-ord for first tile.
float | getBaseYCoord (const Size &sz) const
| Return base y co-ord for first tile.
Size | getDestinationSize () const
| Return target size to be used for each tile.

## Protected Attributes

HorzFormatting | d_horzFormat
| Currently set horizontal formatting option.
VertFormatting | d_vertFormat
| Currently set vertical formatting option.
QuadSplitMode | d_quadSplitMode
| Currently set quad split mode.
const Image * | d_image
| Pointer to the actual Image to be displayed.

## Detailed Description

A higher order GUI entity that represents a renderable image with formatting options.

This class is intended to be used where a (usually top-level) GUI element needs to draw an image that requires some additional formatting. It is possible to specify the Image that is to be rendered, as well as the horizontal and vertical formatting required.

## Member Enumeration Documentation

enum CEGUI::RenderableImage::HorzFormatting

Enumeration of horizontal formatting options for a RenderableImage.

Enumerator:

  LeftAligned | Image will be rendered at it's natural size and with it's left edge aligned with the left edge of the RenderableImage rect.
  RightAligned | Image will be rendered at it's natural size and with it's right edge aligned with the right edge of the RenderableImage rect.
  HorzCentred | Image will be rendered at it's natural size and horizontally centred within the RenderableImage rect.
  HorzStretched | Image will be horizontally stretched to cover the entire width of the RenderableImage rect.
  HorzTiled | Image will be tiled horizontally across the width of the RenderableImage rect. The rightmost tile will be clipped to remain within the rect.

enum CEGUI::RenderableImage::VertFormatting

Enumeration of vertical formatting options for a RenderableImage.

Enumerator:

  TopAligned | Image will be rendered at it's natural size and with it's top edge aligned with the top edge of the RenderableImage rect.
  BottomAligned | Image will be rendered at it's natural size and with it's bottom edge aligned with the bottom edge of the RenderableImage rect.
  VertCentred | Image will be rendered at it's natural size and vertically centred within the RenderableImage rect.
  VertStretched | Image will be vertically stretched to cover the entire height of the RenderableImage rect.
  VertTiled | Image will be tiled vertically down the height of the RenderableImage rect. The bottommost tile will be clipped to remain within the rect.

## Member Function Documentation

void CEGUI::RenderableImage::draw_impl | ( | const Vector3 & | position,
|  | const Rect & | clip_rect
| ) | const`[protected]`

Renders the imagery for a RenderableImage element.

Parameters:

  | position | Vector3 object describing the final rendering position for the object.
  | clip_rect | Rect object describing the clipping area for the rendering. No rendering will be performed outside this area.

Returns:
  Nothing.

HorzFormatting CEGUI::RenderableImage::getHorzFormatting | ( | void |  | ) | const`[inline]`

Return current horizontal formatting setting.

Returns:
  One of the HorzFormatting values specifying the formatting set.

const Image* CEGUI::RenderableImage::getImage | ( | void |  | ) | const`[inline]`

Return the Image object currently set to be rendered.

Returns:
  Pointer to the current Image object set for this RenderableImage. May return NULL if no image is set.

QuadSplitMode CEGUI::RenderableImage::getQuadSplitMode | ( | void |  | ) | const`[inline]`

Return current quad split mode setting.

Returns:
  One of the QuadSplitMode values specifying the way quads are split into triangles.

VertFormatting CEGUI::RenderableImage::getVertFormatting | ( | void |  | ) | const`[inline]`

Return current vertical formatting setting.

Returns:
  One of the VertFormatting values specifying the formatting set.

void CEGUI::RenderableImage::setHorzFormatting | ( | HorzFormatting | formatting | ) | `[inline]`

Set the required horizontal formatting.

Parameters:

  | formatting | One of the HorzFormatting values specifying the formatting required.

Returns:
  Nothing

void CEGUI::RenderableImage::setImage | ( | const Image * | image | ) | `[inline]`

Set the Image object to be drawn by this RenderableImage.

Parameters:

  | image | Pointer to the Image object to be rendered. Can be NULL to specify no image is to be rendered.

Returns:
  Nothing.

void CEGUI::RenderableImage::setQuadSplitMode | ( | QuadSplitMode | split_mode | ) | `[inline]`

Set the required quad split mode.

Parameters:

  | split_mode | One of the QuadSplitMode values specifying the way quads are split into triangles.

Returns:
  Nothing

void CEGUI::RenderableImage::setVertFormatting | ( | VertFormatting | formatting | ) | `[inline]`

Set the required vertical formatting.

Parameters:

  | formatting | One of the VertFormatting values specifying the formatting required.

Returns:
  Nothing