![]() |
OGRE
13.6
Object-Oriented Graphics Rendering Engine
|
Represents a layer which is rendered on top of the 'normal' scene contents. More...
#include <OgreOverlay.h>
Public Types | |
typedef std::list< OverlayContainer * > | OverlayContainerList |
Public Member Functions | |
Overlay (const String &name) | |
Constructor: do not call direct, use OverlayManager::create. More... | |
virtual | ~Overlay () |
virtual void | _findVisibleObjects (Camera *cam, RenderQueue *queue, Viewport *vp) |
Internal method to put the overlay contents onto the render queue. More... | |
void | _getWorldTransforms (Matrix4 *xform) const |
Used to transform the overlay when scrolling, scaling etc. More... | |
void | _notifyOrigin (const String &origin) |
Notify this overlay of it's origin. More... | |
void | add2D (OverlayContainer *cont) |
Adds a 2D 'container' to the overlay. More... | |
void | add3D (SceneNode *node) |
Adds a node capable of holding 3D objects to the overlay. More... | |
void | clear () |
Clears the overlay of all attached items. More... | |
virtual OverlayElement * | findElementAt (Real x, Real y) |
This returns a OverlayElement at position x,y. More... | |
const OverlayContainerList & | get2DElements () const |
Returns all 2D elements in this manager. More... | |
OverlayContainer * | getChild (const String &name) |
const String & | getName (void) const |
Gets the name of this overlay. More... | |
const String & | getOrigin (void) const |
Get the origin of this overlay, e.g. More... | |
const Radian & | getRotate (void) const |
Gets the rotation applied to this overlay, in degrees. More... | |
Real | getScaleX (void) const |
Gets the current X scale value. More... | |
Real | getScaleY (void) const |
Gets the current Y scale value. More... | |
Real | getScrollX (void) const |
Gets the current X scroll value. More... | |
Real | getScrollY (void) const |
Gets the current Y scroll value. More... | |
ushort | getZOrder (void) const |
Gets the Z-order of this overlay. More... | |
void | hide (void) |
Hides the overlay if it was visible. More... | |
bool | isInitialised (void) const |
Gets whether the overlay is initialised or not. More... | |
bool | isVisible (void) const |
Gets whether the overlay is displayed or not. More... | |
void | remove2D (OverlayContainer *cont) |
Removes a 2D container from the overlay. More... | |
void | remove3D (SceneNode *node) |
Removes a 3D element from the overlay. More... | |
void | rotate (const Radian &angle) |
Adds the passed in angle to the rotation applied to this overlay. More... | |
void | scroll (Real xoff, Real yoff) |
Scrolls the overlay by the offsets provided. More... | |
void | setRotate (const Radian &angle) |
Sets the rotation applied to this overlay. More... | |
void | setScale (Real x, Real y) |
Sets the scaling factor of this overlay. More... | |
void | setScroll (Real x, Real y) |
Sets the scrolling factor of this overlay. More... | |
void | setVisible (bool visible) |
Shows or hides this overlay. More... | |
void | setZOrder (ushort zorder) |
Alters the Z-order of this overlay. More... | |
void | show (void) |
Shows the overlay if it was hidden. More... | |
Represents a layer which is rendered on top of the 'normal' scene contents.
An overlay is a container for visual components (2D and 3D) which will be rendered after the main scene in order to composite heads-up-displays, menus or other layers on top of the contents of the scene.
typedef std::list<OverlayContainer*> Ogre::Overlay::OverlayContainerList |
Ogre::Overlay::Overlay | ( | const String & | name | ) |
Constructor: do not call direct, use OverlayManager::create.
|
virtual |
OverlayContainer* Ogre::Overlay::getChild | ( | const String & | name | ) |
const String& Ogre::Overlay::getName | ( | void | ) | const |
Gets the name of this overlay.
void Ogre::Overlay::setZOrder | ( | ushort | zorder | ) |
Alters the Z-order of this overlay.
Values between 0 and 650 are valid here.
ushort Ogre::Overlay::getZOrder | ( | void | ) | const |
Gets the Z-order of this overlay.
bool Ogre::Overlay::isVisible | ( | void | ) | const |
Gets whether the overlay is displayed or not.
|
inline |
Gets whether the overlay is initialised or not.
void Ogre::Overlay::show | ( | void | ) |
Shows the overlay if it was hidden.
void Ogre::Overlay::hide | ( | void | ) |
Hides the overlay if it was visible.
void Ogre::Overlay::setVisible | ( | bool | visible | ) |
Shows or hides this overlay.
void Ogre::Overlay::add2D | ( | OverlayContainer * | cont | ) |
Adds a 2D 'container' to the overlay.
Containers are created and managed using the OverlayManager. A container could be as simple as a square panel, or something more complex like a grid or tree view. Containers group collections of other elements, giving them a relative coordinate space and a common z-order. If you want to attach a GUI widget to an overlay, you have to do it via a container.
cont | Pointer to a container to add, created using OverlayManager. |
void Ogre::Overlay::remove2D | ( | OverlayContainer * | cont | ) |
Removes a 2D container from the overlay.
NOT FAST. Consider OverlayElement::hide.
void Ogre::Overlay::add3D | ( | SceneNode * | node | ) |
Adds a node capable of holding 3D objects to the overlay.
Although overlays are traditionally associated with 2D elements, there are reasons why you might want to attach 3D elements to the overlay too. For example, if you wanted to have a 3D cockpit, which was overlaid with a HUD, then you would create 2 overlays, one with a 3D object attached for the cockpit, and one with the HUD elements attached (the zorder of the HUD overlay would be higher than the cockpit to ensure it was always on top).
void Ogre::Overlay::remove3D | ( | SceneNode * | node | ) |
Removes a 3D element from the overlay.
void Ogre::Overlay::clear | ( | ) |
Clears the overlay of all attached items.
Sets the scrolling factor of this overlay.
You can use this to set an offset to be used to scroll an overlay around the screen.
x | Horizontal scroll value, where 0 = normal, -0.5 = scroll so that only the right half the screen is visible etc |
y | Vertical scroll value, where 0 = normal, 0.5 = scroll down by half a screen etc. |
Real Ogre::Overlay::getScrollX | ( | void | ) | const |
Gets the current X scroll value.
Real Ogre::Overlay::getScrollY | ( | void | ) | const |
Gets the current Y scroll value.
Scrolls the overlay by the offsets provided.
This method moves the overlay by the amounts provided. As with other methods on this object, a full screen width / height is represented by the value 1.0.
void Ogre::Overlay::setRotate | ( | const Radian & | angle | ) |
Sets the rotation applied to this overlay.
|
inline |
Gets the rotation applied to this overlay, in degrees.
void Ogre::Overlay::rotate | ( | const Radian & | angle | ) |
Adds the passed in angle to the rotation applied to this overlay.
Sets the scaling factor of this overlay.
You can use this to set an scale factor to be used to zoom an overlay.
x | Horizontal scale value, where 1.0 = normal, 0.5 = half size etc |
y | Vertical scale value, where 1.0 = normal, 0.5 = half size etc |
Real Ogre::Overlay::getScaleX | ( | void | ) | const |
Gets the current X scale value.
Real Ogre::Overlay::getScaleY | ( | void | ) | const |
Gets the current Y scale value.
void Ogre::Overlay::_getWorldTransforms | ( | Matrix4 * | xform | ) | const |
Used to transform the overlay when scrolling, scaling etc.
|
virtual |
Internal method to put the overlay contents onto the render queue.
Reimplemented in Ogre::ImGuiOverlay.
|
virtual |
This returns a OverlayElement at position x,y.
|
inline |
Returns all 2D elements in this manager.
|
inline |
Get the origin of this overlay, e.g.
a script file name.
This property will only contain something if the creator of this overlay chose to populate it. Script loaders are advised to populate it.
|
inline |
Notify this overlay of it's origin.