#include <OpenGUI_Cursor.h>
Inheritance diagram for OpenGUI::Cursor:

All cursors need to derive from this base class. Cursors are drawn using the same onDraw event logic that Widgets utilize, so creating custom cursors should be a fairly simple task for anyone with experience creating custom widgets. The only major differences between drawing a Widget and drawing a Cursor is that the onDraw event is called each time the Screen is updated and is never cached, and the event arguments are of a different type (DrawCursor_EventArgs). The Brush that is given in the DrawCursor_EventArgs of onDraw() is always in the context of the Screen as a whole, so you need to apply your own Brush::pushPosition() as necessary.
eat() the event or not makes no difference.
When implementing your own cursors, you should take notice of the Size property that the Cursor base class exposes. This property represents the display size of the cursor for both the X and Y axis in Screen units. If the size is never specified by the application it will be the default size of (20.0x20.0f).
Public Member Functions | |
| const String & | getName () const |
| return the name of this cursor, as set by the CursorManager at creation | |
| const FVector2 & | getSize () const |
| returns the size of this cursor | |
| void | setSize (const FVector2 &newSize) |
| sets the size of this cursor | |
| virtual ObjectAccessorList * | getAccessors () |
| returns this object's ObjectAccessorList head | |
| virtual unsigned int | getObjectType () const |
| Returns an integer identifying the type of object. | |
Event Injectors | |
| void | eventDraw (float xPos, float yPos, Brush &brush) |
| Draw this object's foreground using the given brush. | |
| void | eventCursorMove (float xPos, float yPos) |
| Called for cursor movement, giving the X,Y position of the cursor. | |
| void | eventCursorPress (float xPos, float yPos) |
| Called when the cursor button is pressed. | |
| void | eventCursorRelease (float xPos, float yPos) |
| Called when the cursor button is released. | |
| void | eventCursorHidden () |
| Called when the cursor is hidden. | |
| void | eventCursorShown (float xPos, float yPos) |
| Called when the cursor is shown. | |
Protected Member Functions | |
Event Handlers | |
| virtual void | onDraw (Object *sender, DrawCursor_EventArgs &evtArgs) |
| "Draw" event | |
| virtual void | onCursorMove (Object *sender, Cursor_EventArgs &evtArgs) |
| "CursorMove" event | |
| virtual void | onCursorPress (Object *sender, Cursor_EventArgs &evtArgs) |
| "CursorPress" event | |
| virtual void | onCursorRelease (Object *sender, Cursor_EventArgs &evtArgs) |
| "CursorRelease" event | |
| virtual void | onCursorHidden (Object *sender, EventArgs &evtArgs) |
| "CursorHidden" event | |
| virtual void | onCursorShown (Object *sender, Cursor_EventArgs &evtArgs) |
| "CursorShown" event | |
|
|
Called when the cursor is hidden.
|
|
||||||||||||
|
Called for cursor movement, giving the X,Y position of the cursor.
|
|
||||||||||||
|
Called when the cursor button is pressed.
|
|
||||||||||||
|
Called when the cursor button is released.
|
|
||||||||||||
|
Called when the cursor is shown.
|
|
||||||||||||||||
|
Draw this object's foreground using the given brush.
|
|
|
returns this object's ObjectAccessorList head
Reimplemented from OpenGUI::Object. Reimplemented in OpenGUI::GenericCursor. |
|
|
return the name of this cursor, as set by the CursorManager at creation
|
|
|
Returns an integer identifying the type of object.
Implements OpenGUI::Object. |
|
|
returns the size of this cursor
|
|
||||||||||||
|
"CursorHidden" event Default is to do nothing |
|
||||||||||||
|
"CursorMove" event Default is to do nothing |
|
||||||||||||
|
"CursorPress" event Default is to do nothing |
|
||||||||||||
|
"CursorRelease" event Default is to do nothing |
|
||||||||||||
|
"CursorShown" event Default is to do nothing |
|
||||||||||||
|
"Draw" event Default is to do nothing Reimplemented in OpenGUI::GenericCursor. |
|
|
sets the size of this cursor
|