Go to the documentation of this file.
29 #ifndef __OverlayElement_H__
30 #define __OverlayElement_H__
35 #include "OgreUTFString.h"
49 #if OGRE_UNICODE_SUPPORT
51 # define OGRE_DEREF_DISPLAYSTRING_ITERATOR(it) it.getCharacter()
54 # define OGRE_DEREF_DISPLAYSTRING_ITERATOR(it) *it
357 bool debugRenderables =
false);
451 {
return mCloneable; }
472 return 10000.0f - (
Real)getZOrder();
488 return mSourceTemplate ;
virtual void setHorizontalAlignment(GuiHorizontalAlignment gha)
Sets the horizontal origin for this element.
GuiHorizontalAlignment mHorzAlign
Command object for OverlayElement - see ParamCommand.
OverlayElement(const String &name)
Constructor: do not call direct, use OverlayManager::createElement.
Command object for OverlayElement - see ParamCommand.
Abstract definition of a 2D element to be displayed in an Overlay.
virtual const ColourValue & getColour(void) const
Gets the colour for this element.
Real _getHeight(void) const
Gets the height of this element in relation to the screen (where 1.0 = screen height)
static OverlayElementCommands::CmdWidth msWidthCmd
virtual bool isKeyEnabled() const
Superclass for all objects that wish to use custom memory allocators when their new / delete operator...
static OverlayElementCommands::CmdLeft msLeftCmd
virtual void _updateFromParent(void)
Updates this elements transform based on it's parent.
Command object for OverlayElement - see ParamCommand.
A viewpoint from which the scene will be rendered.
virtual const String & getMaterialName(void) const
Gets the name of the material this element uses.
virtual void setVerticalAlignment(GuiVerticalAlignment gva)
Sets the vertical origin for this element.
void setLeft(Real left)
Sets the left of this element in relation to the screen (where 0 = far left, 1.0 = far right)
Overlay * mOverlay
Overlay attached to.
virtual void _notifyParent(OverlayContainer *parent, Overlay *overlay)
Internal method for notifying the GUI element of it's parent and ultimate overlay.
Command object for OverlayElement - see ParamCommand.
OverlayContainer * mParent
Parent pointer.
virtual void hide(void)
Hides this element if it was visible.
virtual const DisplayString & getCaption(void) const
Gets the caption for this element.
GuiMetricsMode
Enum describing how the position / size of an element is to be recorded.
void _setPosition(Real left, Real top)
Sets the left and top of this element in relation to the screen (where 1.0 = screen width)
virtual void setCaption(const DisplayString &text)
Sets the caption on elements that support it.
virtual void _notifyViewport()
Internal method to notify the element when the viewport of parent overlay has changed.
static OverlayElementCommands::CmdHeight msHeightCmd
virtual void setColour(const ColourValue &col)
Sets the colour on elements that support it.
bool mEnabled
Is element enabled?
void setHeight(Real height)
Sets the height of this element in relation to the screen (where 1.0 = screen height)
void _setLeft(Real left)
Sets the left of this element in relation to the screen (where 1.0 = screen width)
virtual ~OverlayElement()
GuiHorizontalAlignment
Enum describing where '0' is in relation to the parent in the horizontal dimension.
virtual void show(void)
Shows this element if it was hidden.
virtual OverlayElement * findElementAt(Real x, Real y)
Returns true if xy is within the constraints of the component.
virtual Real _getDerivedLeft(void)
Gets the 'left' position as derived from own left and that of parents.
virtual ushort _notifyZOrder(ushort newZOrder)
Internal method to notify the element when Z-order of parent overlay has changed.
virtual bool isContainer() const
returns false as this class is not a container type
virtual void _update(void)
Internal method to update the element based on transforms applied.
Command object for OverlayElement - see ParamCommand.
virtual void copyFromTemplate(OverlayElement *templateOverlay)
Command object for OverlayElement - see ParamCommand.
virtual void setEnabled(bool b)
Real _getWidth(void) const
Gets the width of this element in relation to the screen (where 1.0 = screen width)
GuiMetricsMode mMetricsMode
virtual void _notifyWorldTransforms(const Matrix4 &xform)
Internal method to notify the element when it's world transform of parent overlay has changed.
static OverlayElementCommands::CmdHorizontalAlign msHorizontalAlignCmd
Class encapsulating a standard 4x4 homogeneous matrix.
const OverlayElement * getSourceTemplate() const
Returns the SourceTemplate for this element.
void setPosition(Real left, Real top)
Sets the position of the top-left corner of the element, relative to the screen size (1....
void visitRenderables(Renderable::Visitor *visitor, bool debugRenderables=false)
Method to allow a caller to abstractly iterate over the Renderable instances that this MovableObject ...
virtual Real _getDerivedTop(void)
Gets the 'top' position as derived from own left and that of parents.
void _setParent(OverlayContainer *parent)
Command object for OverlayElement - see ParamCommand.
Real _getLeft(void) const
Gets the left of this element in relation to the screen (where 0 = far left, 1.0 = far right)
virtual void _positionsOutOfDate(void)
Tell the object to recalculate.
#define _OgreOverlayExport
virtual bool isCloneable() const
void _setTop(Real top)
Sets the top of this element in relation to the screen (where 1.0 = screen width)
virtual void _getClippingRegion(RealRect &clippingRegion)
Gets the clipping region of the element.
Command object for OverlayElement - see ParamCommand.
virtual const String & getTypeName(void) const =0
Gets the type name of the element.
Command object for OverlayElement - see ParamCommand.
@ GMM_PIXELS
Positions & sizes are in absolute pixels.
void getWorldTransforms(Matrix4 *xform) const
See Renderable.
void _setDimensions(Real width, Real height)
Sets the width and height of this element in relation to the screen (where 1.0 = screen width)
virtual void setCloneable(bool c)
virtual GuiVerticalAlignment getVerticalAlignment(void) const
Gets the vertical alignment for this element.
Class defining the common interface which classes can use to present a reflection-style,...
void _setHeight(Real height)
Sets the height of this element in relation to the screen (where 1.0 = screen width)
virtual void initialise(void)=0
Initialise gui element.
bool mGeomPositionsOutOfDate
Flag indicating if the vertex positions need recalculating.
static OverlayElementCommands::CmdMetricsMode msMetricsModeCmd
Real getLeft(void) const
Gets the left of this element in relation to the screen (where 0 = far left, 1.0 = far right)
Real getSquaredViewDepth(const Camera *cam) const
Overridden from Renderable.
static OverlayElementCommands::CmdVerticalAlign msVerticalAlignCmd
void _setWidth(Real width)
Sets the width of this element in relation to the screen (where 1.0 = screen width)
const String & getName(void) const
Gets the name of this overlay.
bool isVisible(void) const
Returns whether or not the element is visible.
virtual OverlayElement * clone(const String &instanceName)
Real getWidth(void) const
Gets the width of this element in relation to the screen (where 1.0 = screen width)
void setDimensions(Real width, Real height)
Sets the dimensions of this element in relation to the screen (1.0 = screen width/height).
Class representing colour.
static OverlayElementCommands::CmdVisible msVisibleCmd
const MaterialPtr & getMaterial(void) const
See Renderable.
const LightList & getLights(void) const
Gets a list of lights, ordered relative to how close they are to this renderable.
ushort getZOrder() const
Returns the zOrder of the element.
virtual void setMetricsMode(GuiMetricsMode gmm)
Tells this element how to interpret the position and dimension values it is given.
virtual Real _getRelativeWidth(void)
Gets the 'width' as derived from own width and metrics mode.
virtual GuiHorizontalAlignment getHorizontalAlignment(void) const
Gets the horizontal alignment for this element.
Visitor object that can be used to iterate over a collection of Renderable instances abstractly.
Abstract class defining the interface all renderable objects must implement.
GuiVerticalAlignment
Enum describing where '0' is in relation to the parent in the vertical dimension.
@ GMM_RELATIVE
'left', 'top', 'height' and 'width' are parametrics from 0.0 to 1.0
void setTop(Real Top)
Sets the top of this element in relation to the screen (where 0 = top, 1.0 = bottom)
float Real
Software floating point type.
virtual void setMaterialName(const String &matName)
Sets the name of the material this element will use.
Real _getTop(void) const
Gets the top of this element in relation to the screen (where 0 = far left, 1.0 = far right)
Real getTop(void) const
Gets the top of this element in relation to the screen (where 0 = top, 1.0 = bottom)
OverlayElement * mSourceTemplate
Used to see if this element is created from a Template.
Command object for OverlayElement - see ParamCommand.
virtual Real _getRelativeHeight(void)
Gets the 'height' as derived from own height and metrics mode.
OverlayContainer * getParent()
Returns the parent container.
Real getHeight(void) const
Gets the height of this element in relation to the screen (where 1.0 = screen height)
virtual void addBaseParameters(void)
Internal method for setting up the basic parameter definitions for a subclass.
virtual bool contains(Real x, Real y) const
Returns true if xy is within the constraints of the component.
virtual void _updateRenderQueue(RenderQueue *queue)
Internal method to put the contents onto the render queue.
bool mGeomUVsOutOfDate
Flag indicating if the vertex uvs need recalculating.
virtual GuiMetricsMode getMetricsMode(void) const
Retrieves the current settings of how the element metrics are interpreted.
Matrix4 mXForm
World transforms.
void setWidth(Real width)
Sets the width of this element in relation to the screen (where 1.0 = screen width)
static OverlayElementCommands::CmdCaption msCaptionCmd
bool mInitialised
Is element initialised?
Represents a layer which is rendered on top of the 'normal' scene contents.
virtual void updatePositionGeometry(void)=0
Internal method which is triggered when the positions of the element get updated, meaning the element...
Class to manage the scene object rendering queue.
virtual void updateTextureGeometry(void)=0
Internal method which is triggered when the UVs of the element get updated, meaning the element shoul...
A 2D element which contains other OverlayElement instances.
static OverlayElementCommands::CmdTop msTopCmd
static OverlayElementCommands::CmdMaterial msMaterialCmd
GuiVerticalAlignment mVertAlign
@ GMM_RELATIVE_ASPECT_ADJUSTED
Positions & sizes are in virtual pixels.
ushort mZOrder
Zorder for when sending to render queue.
Copyright © 2012 Torus Knot Software Ltd

This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.