Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members

CEGUI::RenderableFrame Class Reference

A higher order GUI entity that represents a renderable frame. More...

#include <CEGUIRenderableFrame.h>

Inheritance diagram for CEGUI::RenderableFrame:

Inheritance graph
[legend]
Collaboration diagram for CEGUI::RenderableFrame:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 RenderableFrame (void)
 Default constructor for RenderableFrame.
virtual ~RenderableFrame (void)
 Destructor for RenderableFrame.
void setImages (const Image *topleft, const Image *topright, const Image *bottomleft, const Image *bottomright, const Image *left, const Image *top, const Image *right, const Image *bottom)
 specify the Image objects to use for each part of the frame. A NULL may be used to omit any part.
void setImageForLocation (FrameLocation location, const Image *image)
 Set the Image to use for the specified location of the frame.
const ImagegetImageForLocation (FrameLocation location) const
 Return the Image being used for the specified location of the frame.
void draw (const Vector3 &position, const Rect &clip_rect)
 Draw the element chain starting with this element.
RenderableElementgetNextElement (void) const
 Return a pointer to the next RenderableElement in the chain.
ColourRect getColours (void) const
 Return the rendering colours set for this RenderableElement.
Point getPosition (void) const
 Return the offset position of this RenderableElement.
Size getSize (void) const
 Return the current size of the element.
Rect getRect (void) const
 Return the area for the element.
bool isColourRectPerImage (bool setting)
 return whether the element colours will be applied locally to each image drawn as part of the RenderableElement, or applied across the whole of the RenderableElement area.
void setNextElement (RenderableElement *element)
 Link another RenderableElement to this one.
void setColours (const ColourRect &colours)
 Sets the colours to be applied when rendering the element.
void setColours (const colour &top_left_colour, const colour &top_right_colour, const colour &bottom_left_colour, const colour &bottom_right_colour)
 Sets the colours to be applied when rendering the element.
void setPosition (const Point &position)
 Set the rendering offset position for this element.
void setSize (const Size &size)
 set the dimensions for the frame.
void setRect (const Rect &area)
 Set the area for the frame.
void setColourRectPerImage (bool setting)
 set whether the element colours should be applied locally to each image drawn as part of the RenderableElement, or applied across the whole of the RenderableElement area.

Protected Member Functions

void draw_impl (const Vector3 &position, const Rect &clip_rect) const
 Renders the imagery for a RenderableFrame element.

Protected Attributes

const Imaged_topleft
 Image to draw for the top-left corner.
const Imaged_topright
 Image to draw for the top-right corner.
const Imaged_bottomleft
 Image to draw for the bottom-left corner.
const Imaged_bottomright
 Image to draw for the bottom-right corner.
const Imaged_left
 Image to draw for the left edge.
const Imaged_right
 Image to draw for the right edge.
const Imaged_top
 Image to draw for the top edge.
const Imaged_bottom
 Image to draw for the bottom edge.
RenderableElementd_next
 Link to another RenderableElement.
ColourRect d_colours
 Colours to be used for this element;.
Rect d_area
 Currently defined area for this element.
bool d_useColoursPerImage
 true if d_colours should be applied separately to each Image drawn (false to interpolate across d_area).

Detailed Description

A higher order GUI entity that represents a renderable frame.

This class is intended to be used where a (usually top-level) GUI element needs to draw a frame that is constructed from a collection of Images. It is possible to specify the image to use for each of the four corners, which are placed appropriately at their natural size, and the images for the four edges, which are stretched to cover the area between any corner images. Any of the Images may be omitted, in which case that part of the frame is not drawn. If the GUI element uses only one image for its frame (usually stretched over the entire area of the element) then a better choice would be to use a RenderableImage, or perform the rendering directly instead.

Definition at line 65 of file CEGUIRenderableFrame.h.


Constructor & Destructor Documentation

CEGUI::RenderableFrame::RenderableFrame void   ) 
 

Default constructor for RenderableFrame.

Definition at line 36 of file CEGUIRenderableFrame.cpp.

References d_bottom, d_bottomleft, d_bottomright, d_left, d_right, d_top, d_topleft, and d_topright.

CEGUI::RenderableFrame::~RenderableFrame void   )  [virtual]
 

Destructor for RenderableFrame.

Definition at line 46 of file CEGUIRenderableFrame.cpp.


Member Function Documentation

void CEGUI::RenderableElement::draw const Vector3 position,
const Rect clip_rect
[inherited]
 

Draw the element chain starting with this element.

Parameters:
position Vector3 object describing the base position to be used when rendering the element chain. Each element in the chain will be offset from this position by it's own internal position setting.
clip_rect Rect object describing the clipping area. No rendering will appear outside this area.

Definition at line 67 of file CEGUIRenderableElement.cpp.

References CEGUI::RenderableElement::d_area, CEGUI::Rect::d_left, CEGUI::RenderableElement::d_next, CEGUI::Rect::d_top, CEGUI::Vector3::d_x, CEGUI::Vector3::d_y, and CEGUI::RenderableElement::draw_impl().

Referenced by CEGUI::StaticImage::drawSelf(), and CEGUI::Static::drawSelf().

void CEGUI::RenderableFrame::draw_impl const Vector3 position,
const Rect clip_rect
const [protected, virtual]
 

Renders the imagery for a RenderableFrame 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.

Implements CEGUI::RenderableElement.

Definition at line 71 of file CEGUIRenderableFrame.cpp.

References d_bottom, d_bottomleft, d_bottomright, CEGUI::Size::d_height, d_left, d_right, d_top, d_topleft, d_topright, CEGUI::Size::d_width, CEGUI::Vector3::d_x, CEGUI::Vector3::d_y, CEGUI::Image::draw(), CEGUI::Image::getHeight(), CEGUI::Rect::getHeight(), CEGUI::Image::getOffsetX(), CEGUI::Image::getOffsetY(), CEGUI::ColourRect::getSubRectangle(), CEGUI::Image::getWidth(), and CEGUI::Rect::getWidth().

ColourRect CEGUI::RenderableElement::getColours void   )  const [inline, inherited]
 

Return the rendering colours set for this RenderableElement.

Returns:
ColourRect object describing the colours to be used when rendering this RenderableElement.

Definition at line 82 of file CEGUIRenderableElement.h.

const Image * CEGUI::RenderableFrame::getImageForLocation FrameLocation  location  )  const
 

Return the Image being used for the specified location of the frame.

Parameters:
location One of the FrameLocation enumerated values specifying the image to be returned.
Returns:
Pointer to the Image object currently set for the frame location specified in location. May return NULL if no Image is set for the requested position.

Definition at line 403 of file CEGUIRenderableFrame.cpp.

References CEGUI::BottomEdge, CEGUI::BottomLeftCorner, CEGUI::BottomRightCorner, CEGUI::LeftEdge, CEGUI::RightEdge, CEGUI::TopEdge, CEGUI::TopLeftCorner, and CEGUI::TopRightCorner.

Referenced by CEGUI::Static::getImageForFrameLocation().

RenderableElement* CEGUI::RenderableElement::getNextElement void   )  const [inline, inherited]
 

Return a pointer to the next RenderableElement in the chain.

Returns:
Pointer to a RenderableElement object that is linked this this one. May be NULL for none.

Definition at line 72 of file CEGUIRenderableElement.h.

Point CEGUI::RenderableElement::getPosition void   )  const [inline, inherited]
 

Return the offset position of this RenderableElement.

Returns:
Point object describing the offset position that this RenderableElement is to be rendered at. This value is added to whatever position is specified when the RenderableElement::draw method is called to obtain the final rendering position.

Definition at line 94 of file CEGUIRenderableElement.h.

References CEGUI::Point.

Rect CEGUI::RenderableElement::getRect void   )  const [inline, inherited]
 

Return the area for the element.

Returns:
Rect object describing the pixel area (offset from some unknown location) of the frame.

Definition at line 114 of file CEGUIRenderableElement.h.

Size CEGUI::RenderableElement::getSize void   )  const [inline, inherited]
 

Return the current size of the element.

Returns:
Size object describing the current size of the RenderableFrame.

Definition at line 104 of file CEGUIRenderableElement.h.

bool CEGUI::RenderableElement::isColourRectPerImage bool  setting  )  [inline, inherited]
 

return whether the element colours will be applied locally to each image drawn as part of the RenderableElement, or applied across the whole of the RenderableElement area.

Returns:

Definition at line 126 of file CEGUIRenderableElement.h.

void CEGUI::RenderableElement::setColourRectPerImage bool  setting  )  [inline, inherited]
 

set whether the element colours should be applied locally to each image drawn as part of the RenderableElement, or applied across the whole of the RenderableElement area.

Parameters:
setting 
Returns:
Nothing.

Definition at line 234 of file CEGUIRenderableElement.h.

void CEGUI::RenderableElement::setColours const colour top_left_colour,
const colour top_right_colour,
const colour bottom_left_colour,
const colour bottom_right_colour
[inherited]
 

Sets the colours to be applied when rendering the element.

Parameters:
top_left_colour Colour to be applied to the top-left corner of each Image used in the element.
top_right_colour Colour to be applied to the top-right corner of each Image used in the element.
bottom_left_colour Colour to be applied to the bottom-left corner of each Image used in the element.
bottom_right_colour Colour to be applied to the bottom-right corner of each Image used in the element.
Returns:
Nothing.

Definition at line 55 of file CEGUIRenderableElement.cpp.

References CEGUI::ColourRect::d_bottom_left, CEGUI::ColourRect::d_bottom_right, CEGUI::RenderableElement::d_colours, CEGUI::ColourRect::d_top_left, and CEGUI::ColourRect::d_top_right.

void CEGUI::RenderableElement::setColours const ColourRect colours  )  [inline, inherited]
 

Sets the colours to be applied when rendering the element.

Parameters:
colours ColourRect object describing the colours to be used.
Returns:
Nothing.

Definition at line 159 of file CEGUIRenderableElement.h.

Referenced by CEGUI::Static::updateRenderableFrameColours(), and CEGUI::StaticImage::updateRenderableImageColours().

void CEGUI::RenderableFrame::setImageForLocation FrameLocation  location,
const Image image
 

Set the Image to use for the specified location of the frame.

Parameters:
location One of the FrameLocation enumerated values specifying the image to be returned.
image Pointer to the Image to use for the frame location specified in location. May be NULL to indicate the frame component is not required.
Returns:
Nothing.

Definition at line 357 of file CEGUIRenderableFrame.cpp.

References CEGUI::BottomEdge, CEGUI::BottomLeftCorner, CEGUI::BottomRightCorner, d_bottom, d_bottomleft, d_bottomright, d_left, d_right, d_top, d_topleft, d_topright, CEGUI::LeftEdge, CEGUI::RightEdge, CEGUI::TopEdge, CEGUI::TopLeftCorner, and CEGUI::TopRightCorner.

Referenced by CEGUI::Static::setImageForFrameLocation().

void CEGUI::RenderableFrame::setImages const Image topleft,
const Image topright,
const Image bottomleft,
const Image bottomright,
const Image left,
const Image top,
const Image right,
const Image bottom
 

specify the Image objects to use for each part of the frame. A NULL may be used to omit any part.

Parameters:
topleft Pointer to an Image object to render as the top-left corner of the frame. Specify NULL to omit this part of the frame.
topright Pointer to an Image object to render as the top-right corner of the frame. Specify NULL to omit this part of the frame.
bottomleft Pointer to an Image object to render as the bottom-left corner of the frame. Specify NULL to omit this part of the frame.
bottomright Pointer to an Image object to render as the bottom-right corner of the frame. Specify NULL to omit this part of the frame.
left Pointer to an Image object to render as the left edge of the frame. Specify NULL to omit this part of the frame.
top Pointer to an Image object to render as the top edge of the frame. Specify NULL to omit this part of the frame.
right Pointer to an Image object to render as the right edge of the frame. Specify NULL to omit this part of the frame.
bottom Pointer to an Image object to render as the bottom edge of the frame. Specify NULL to omit this part of the frame.
Returns:
Nothing

Definition at line 54 of file CEGUIRenderableFrame.cpp.

References d_bottom, d_bottomleft, d_bottomright, d_left, d_right, d_top, d_topleft, and d_topright.

Referenced by CEGUI::Static::setFrameImages().

void CEGUI::RenderableElement::setNextElement RenderableElement element  )  [inline, inherited]
 

Link another RenderableElement to this one.

The linked element will be drawn whenever this element is drawn using the same base position and clipping area as provided when the RenderableElement::draw method is called. Whole chains of Renderable Elements can be created using this system.

Parameters:
element Pointer to a RenderableElement object that will be linked to this element.
Returns:
Nothing.

Definition at line 146 of file CEGUIRenderableElement.h.

void CEGUI::RenderableElement::setPosition const Point position  )  [inline, inherited]
 

Set the rendering offset position for this element.

Parameters:
position Point object describing the offset position to use for this element. This value is added to whatever position is specified when the RenderableElement::draw method is called to obtain the final rendering position.
Returns:
Nothing.

Definition at line 196 of file CEGUIRenderableElement.h.

References CEGUI::Point.

void CEGUI::RenderableElement::setRect const Rect area  )  [inline, inherited]
 

Set the area for the frame.

Parameters:
area Rect object describing the pixel area (offset from some unknown location) of the frame.
Returns:
None.

Definition at line 219 of file CEGUIRenderableElement.h.

void CEGUI::RenderableElement::setSize const Size size  )  [inline, inherited]
 

set the dimensions for the frame.

Parameters:
size Size object describing the new size for the frame (in pixels)

Definition at line 206 of file CEGUIRenderableElement.h.

Referenced by CEGUI::StaticImage::onSized(), CEGUI::Static::onSized(), and CEGUI::StaticImage::onStaticFrameChanged().


Member Data Documentation

Rect CEGUI::RenderableElement::d_area [protected, inherited]
 

Currently defined area for this element.

Definition at line 280 of file CEGUIRenderableElement.h.

Referenced by CEGUI::RenderableElement::draw().

const Image* CEGUI::RenderableFrame::d_bottom [protected]
 

Image to draw for the bottom edge.

Definition at line 182 of file CEGUIRenderableFrame.h.

Referenced by draw_impl(), RenderableFrame(), setImageForLocation(), and setImages().

const Image* CEGUI::RenderableFrame::d_bottomleft [protected]
 

Image to draw for the bottom-left corner.

Definition at line 177 of file CEGUIRenderableFrame.h.

Referenced by draw_impl(), RenderableFrame(), setImageForLocation(), and setImages().

const Image* CEGUI::RenderableFrame::d_bottomright [protected]
 

Image to draw for the bottom-right corner.

Definition at line 178 of file CEGUIRenderableFrame.h.

Referenced by draw_impl(), RenderableFrame(), setImageForLocation(), and setImages().

ColourRect CEGUI::RenderableElement::d_colours [protected, inherited]
 

Colours to be used for this element;.

Definition at line 279 of file CEGUIRenderableElement.h.

Referenced by CEGUI::RenderableElement::setColours().

const Image* CEGUI::RenderableFrame::d_left [protected]
 

Image to draw for the left edge.

Definition at line 179 of file CEGUIRenderableFrame.h.

Referenced by draw_impl(), RenderableFrame(), setImageForLocation(), and setImages().

RenderableElement* CEGUI::RenderableElement::d_next [protected, inherited]
 

Link to another RenderableElement.

Definition at line 278 of file CEGUIRenderableElement.h.

Referenced by CEGUI::RenderableElement::draw().

const Image* CEGUI::RenderableFrame::d_right [protected]
 

Image to draw for the right edge.

Definition at line 180 of file CEGUIRenderableFrame.h.

Referenced by draw_impl(), RenderableFrame(), setImageForLocation(), and setImages().

const Image* CEGUI::RenderableFrame::d_top [protected]
 

Image to draw for the top edge.

Definition at line 181 of file CEGUIRenderableFrame.h.

Referenced by draw_impl(), RenderableFrame(), setImageForLocation(), and setImages().

const Image* CEGUI::RenderableFrame::d_topleft [protected]
 

Image to draw for the top-left corner.

Definition at line 175 of file CEGUIRenderableFrame.h.

Referenced by draw_impl(), RenderableFrame(), setImageForLocation(), and setImages().

const Image* CEGUI::RenderableFrame::d_topright [protected]
 

Image to draw for the top-right corner.

Definition at line 176 of file CEGUIRenderableFrame.h.

Referenced by draw_impl(), RenderableFrame(), setImageForLocation(), and setImages().

bool CEGUI::RenderableElement::d_useColoursPerImage [protected, inherited]
 

true if d_colours should be applied separately to each Image drawn (false to interpolate across d_area).

Definition at line 281 of file CEGUIRenderableElement.h.


The documentation for this class was generated from the following files:
Generated on Wed Feb 16 12:41:10 2005 for Crazy Eddies GUI System by  doxygen 1.3.9.1