NaviLibrary::NaviMouse Class Reference

#include <NaviMouse.h>

List of all members.

Public Member Functions

 NaviMouse (unsigned short width=64, unsigned short height=64, bool visibility=true)
NaviCursorcreateCursor (const std::string &cursorName, unsigned short hotspotX=0, unsigned short hotspotY=0)
void setDefaultCursor (const std::string &cursorName)
void removeCursor (const std::string &cursorName)
void activateCursor (std::string cursorName)
void show ()
void hide ()
bool isVisible ()

Static Public Member Functions

static NaviMouseGet ()
static NaviMouseGetPointer ()


Detailed Description

A simple little class that displays a mouse cursor using an Ogre Overlay that follows the mouse coordinates that are injected into NaviManager.

Constructor & Destructor Documentation

NaviMouse::NaviMouse ( unsigned short  width = 64,
unsigned short  height = 64,
bool  visibility = true 
)

Creates the NaviMouse Singleton.

Parameters:
width The width of the NaviMouse cursor (all loaded cursors should be this width to avoid stretching).
height The height of the NaviMouse cursor (all loaded cursors should be this height to avoid stretching).
visibility Whether or not the cursor should be visible upon creation. Use NaviMouse::show() later.


Member Function Documentation

NaviMouse & NaviMouse::Get (  )  [static]

Gets the NaviMouse Singleton.

Returns:
A reference to the NaviMouse Singleton.
Exceptions:
Ogre::Exception::ERR_RT_ASSERTION_FAILED Throws this if NaviMouse has not been instantiated yet.

NaviMouse * NaviMouse::GetPointer (  )  [static]

Gets the NaviMouse Singleton as a pointer.

Returns:
If the NaviMouse has been instantiated, returns a pointer to the NaviManager Singleton, otherwise this returns 0.

NaviCursor * NaviMouse::createCursor ( const std::string &  cursorName,
unsigned short  hotspotX = 0,
unsigned short  hotspotY = 0 
)

Creates a cursor for use with this NaviMouse.

Parameters:
cursorName The name of the cursor, used to activate or remove the cursor later.
hotspotX Every cursor has a hot spot, which is used to define the single pixel a cursor is pointing to when the mouse is clicked. This is the X-value of the hotspot.
hotspotY The Y-value of the hotspot.

void NaviMouse::setDefaultCursor ( const std::string &  cursorName  ) 

This should be called before NaviManager begins updating the mouse. Sets the default cursor for the mouse.

Parameters:
cursorName The name of the cursor, from here on you may refer to this cursor by this cursorName or by "default", both will work. You may not remove a default cursor.

void NaviMouse::removeCursor ( const std::string &  cursorName  ) 

Removes a cursor from this NaviMouse.

Parameters:
cursorName The cursor to remove. You may not remove a default cursor. If you try to remove a cursor that is currently active, the cursor will change to the default cursor after removal.

void NaviMouse::activateCursor ( std::string  cursorName  ) 

Changes the active cursor to a specified cursor.

Parameters:
cursorName The name of the cursor to change to. To change to the default cursor, simply specify "default". If the cursor cannot be found, nothing will happen.

void NaviMouse::show (  ) 

Displays the mouse cursor (if it is hidden via NaviMouse::hide).

void NaviMouse::hide (  ) 

Hides the mouse cursor. Show it again via NaviMouse::show.

bool NaviMouse::isVisible (  ) 

Returns whether or not the mouse cursor is visible.


The documentation for this class was generated from the following files:
Generated on Tue Jun 10 22:33:20 2008 for NaviLibrary by  doxygen 1.5.3