OGRE  1.12.5
Object-Oriented Graphics Rendering Engine
Ogre::ImGuiOverlay Class Reference

#include <OgreImGuiOverlay.h>

+ Inheritance diagram for Ogre::ImGuiOverlay:

Public Types

typedef std::list< OverlayContainer * > OverlayContainerList
 

Public Member Functions

 ImGuiOverlay ()
 
 ~ImGuiOverlay ()
 
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...
 
ImFont * addFont (const String &name, const String &group=RGN_DEFAULT)
 add font from ogre .fontdef file must be called before first show() More...
 
void clear ()
 Clears the overlay of all attached items. More...
 
virtual OverlayElementfindElementAt (Real x, Real y)
 This returns a OverlayElement at position x,y. More...
 
const OverlayContainerListget2DElements () const
 Returns all 2D elements in this manager. More...
 
OverlayContainergetChild (const String &name)
 
const StringgetName (void) const
 Gets the name of this overlay. More...
 
const StringgetOrigin (void) const
 Get the origin of this overlay, e.g. More...
 
const RadiangetRotate (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 setZOrder (ushort zorder)
 Alters the Z-order of this overlay. More...
 
void show (void)
 Shows the overlay if it was hidden. More...
 

Static Public Member Functions

static void NewFrame (const FrameEvent &evt)
 

Member Typedef Documentation

◆ OverlayContainerList

Constructor & Destructor Documentation

◆ ImGuiOverlay()

Ogre::ImGuiOverlay::ImGuiOverlay ( )

◆ ~ImGuiOverlay()

Ogre::ImGuiOverlay::~ImGuiOverlay ( )

Member Function Documentation

◆ addFont()

ImFont* Ogre::ImGuiOverlay::addFont ( const String name,
const String group = RGN_DEFAULT 
)

add font from ogre .fontdef file must be called before first show()

◆ NewFrame()

static void Ogre::ImGuiOverlay::NewFrame ( const FrameEvent evt)
static

◆ _findVisibleObjects()

void Ogre::ImGuiOverlay::_findVisibleObjects ( Camera cam,
RenderQueue queue,
Viewport vp 
)
virtual

Internal method to put the overlay contents onto the render queue.

Reimplemented from Ogre::Overlay.

◆ getChild()

OverlayContainer* Ogre::Overlay::getChild ( const String name)
inherited

◆ getName()

const String& Ogre::Overlay::getName ( void  ) const
inherited

Gets the name of this overlay.

◆ setZOrder()

void Ogre::Overlay::setZOrder ( ushort  zorder)
inherited

Alters the Z-order of this overlay.

Remarks
Values between 0 and 650 are valid here.

◆ getZOrder()

ushort Ogre::Overlay::getZOrder ( void  ) const
inherited

Gets the Z-order of this overlay.

◆ isVisible()

bool Ogre::Overlay::isVisible ( void  ) const
inherited

Gets whether the overlay is displayed or not.

◆ isInitialised()

bool Ogre::Overlay::isInitialised ( void  ) const
inlineinherited

Gets whether the overlay is initialised or not.

◆ show()

void Ogre::Overlay::show ( void  )
inherited

Shows the overlay if it was hidden.

◆ hide()

void Ogre::Overlay::hide ( void  )
inherited

Hides the overlay if it was visible.

◆ add2D()

void Ogre::Overlay::add2D ( OverlayContainer cont)
inherited

Adds a 2D 'container' to the overlay.

Remarks
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.
Parameters
contPointer to a container to add, created using OverlayManager.

◆ remove2D()

void Ogre::Overlay::remove2D ( OverlayContainer cont)
inherited

Removes a 2D container from the overlay.

Remarks
NOT FAST. Consider OverlayElement::hide.

◆ add3D()

void Ogre::Overlay::add3D ( SceneNode node)
inherited

Adds a node capable of holding 3D objects to the overlay.

Remarks

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).

A SceneNode can have any number of 3D objects attached to it. SceneNodes are usually created using SceneManager::createSceneNode, but in this case you should create a standard SceneNode instance manually; this is because these scene nodes are not managed by the SceneManager and some custom SceneManager plugins will rely on specialist behaviour the overlay does not support. By attaching a SceneNode to an overlay, you indicate that:
  1. You want the contents of this node to only appear when the overlay is active
  2. You want the node to inherit a coordinate space relative to the camera, rather than relative to the root scene node
  3. You want these objects to be rendered after the contents of the main scene to ensure they are rendered on top
One major consideration when using 3D objects in overlays is the behaviour of the depth buffer. Overlays should use materials with depth checking off, to ensure that their contents are always displayed on top of the main scene (to do otherwise would result in objects 'poking through' the overlay). The problem with using 3D objects is that if they are concave, or self-overlap, then you can get artefacts because of the lack of depth buffer checking. So you should ensure that any 3D objects you us in the overlay are convex, and don't overlap each other. If they must overlap, split them up and put them in 2 overlays. Alternatively, use a 2D element underneath them which will clear the depth buffer values underneath ready for the 3D element to be rendered correctly.

◆ remove3D()

void Ogre::Overlay::remove3D ( SceneNode node)
inherited

Removes a 3D element from the overlay.

◆ clear()

void Ogre::Overlay::clear ( )
inherited

Clears the overlay of all attached items.

◆ setScroll()

void Ogre::Overlay::setScroll ( Real  x,
Real  y 
)
inherited

Sets the scrolling factor of this overlay.

Remarks
You can use this to set an offset to be used to scroll an overlay around the screen.
Parameters
xHorizontal scroll value, where 0 = normal, -0.5 = scroll so that only the right half the screen is visible etc
yVertical scroll value, where 0 = normal, 0.5 = scroll down by half a screen etc.

◆ getScrollX()

Real Ogre::Overlay::getScrollX ( void  ) const
inherited

Gets the current X scroll value.

◆ getScrollY()

Real Ogre::Overlay::getScrollY ( void  ) const
inherited

Gets the current Y scroll value.

◆ scroll()

void Ogre::Overlay::scroll ( Real  xoff,
Real  yoff 
)
inherited

Scrolls the overlay by the offsets provided.

Remarks
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.

◆ setRotate()

void Ogre::Overlay::setRotate ( const Radian angle)
inherited

Sets the rotation applied to this overlay.

◆ getRotate()

const Radian& Ogre::Overlay::getRotate ( void  ) const
inlineinherited

Gets the rotation applied to this overlay, in degrees.

◆ rotate()

void Ogre::Overlay::rotate ( const Radian angle)
inherited

Adds the passed in angle to the rotation applied to this overlay.

◆ setScale()

void Ogre::Overlay::setScale ( Real  x,
Real  y 
)
inherited

Sets the scaling factor of this overlay.

Remarks
You can use this to set an scale factor to be used to zoom an overlay.
Parameters
xHorizontal scale value, where 1.0 = normal, 0.5 = half size etc
yVertical scale value, where 1.0 = normal, 0.5 = half size etc

◆ getScaleX()

Real Ogre::Overlay::getScaleX ( void  ) const
inherited

Gets the current X scale value.

◆ getScaleY()

Real Ogre::Overlay::getScaleY ( void  ) const
inherited

Gets the current Y scale value.

◆ _getWorldTransforms()

void Ogre::Overlay::_getWorldTransforms ( Matrix4 xform) const
inherited

Used to transform the overlay when scrolling, scaling etc.

◆ findElementAt()

virtual OverlayElement* Ogre::Overlay::findElementAt ( Real  x,
Real  y 
)
virtualinherited

This returns a OverlayElement at position x,y.

◆ get2DElements()

const OverlayContainerList& Ogre::Overlay::get2DElements ( ) const
inlineinherited

Returns all 2D elements in this manager.

◆ getOrigin()

const String& Ogre::Overlay::getOrigin ( void  ) const
inlineinherited

Get the origin of this overlay, e.g.

a script file name.

Remarks
This property will only contain something if the creator of this overlay chose to populate it. Script loaders are advised to populate it.

◆ _notifyOrigin()

void Ogre::Overlay::_notifyOrigin ( const String origin)
inlineinherited

Notify this overlay of it's origin.


The documentation for this class was generated from the following file: