|
FIFE
2008.0
|
#include <cursor.h>

Public Member Functions | |
| Cursor (RenderBackend *renderbackend) | |
| virtual | ~Cursor () |
| virtual void | draw () |
| void | set (uint32_t cursor_id=0) |
| void | set (ImagePtr image) |
| void | set (AnimationPtr anim) |
| void | setDrag (ImagePtr image, int32_t drag_offset_x=0, int32_t drag_offset_y=0) |
| void | setDrag (AnimationPtr anim, int32_t drag_offset_x=0, int32_t drag_offset_y=0) |
| void | resetDrag () |
| MouseCursorType | getType () const |
| uint32_t | getId () const |
| ImagePtr | getImage () |
| AnimationPtr | getAnimation () |
| MouseCursorType | getDragType () const |
| ImagePtr | getDragImage () |
| AnimationPtr | getDragAnimation () |
| uint32_t | getX () const |
| uint32_t | getY () const |
| void | setPosition (uint32_t x, uint32_t y) |
| void | getPosition (int32_t *x, int32_t *y) |
Protected Member Functions | |
| void | setNativeCursor (uint32_t cursor_id) |
| uint32_t | getNativeId (uint32_t cursor_id) |
| FIFE::Cursor::Cursor | ( | RenderBackend * | renderbackend | ) |
|
virtual |
draws cursor on screen
Definition at line 193 of file cursor.cpp.
References FIFE::Animation::getDuration(), FIFE::Animation::getFrameByTimestamp(), FIFE::TimeManager::getTime(), FIFE::RenderBackend::popClipArea(), FIFE::RenderBackend::pushClipArea(), FIFE::Image::render(), FIFE::RenderBackend::renderVertexArrays(), and set().
Referenced by FIFE::Engine::pump().

|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
protected |
To get some consistancy between platforms, this function checks if cursor_id matches any of the values in NativeCursor, and returns the resource ID specific to the running platform. If no match is found, cursor_id is returned.
| One | of the values in NativeCursor |
Definition at line 244 of file cursor.cpp.
Referenced by setNativeCursor().

| void FIFE::Cursor::getPosition | ( | int32_t * | x, |
| int32_t * | y | ||
| ) |
Get the current mouse position
Definition at line 177 of file cursor.cpp.
|
inline |
|
inline |
|
inline |
| void FIFE::Cursor::resetDrag | ( | ) |
Resets the cursor drag type to CURSOR_NONE
Definition at line 160 of file cursor.cpp.
References FIFE::SharedPtr< T >::reset().
| void FIFE::Cursor::set | ( | uint32_t | cursor_id = 0 | ) |
Sets the current mouse cursor
| cursor_id | For native cursors, this is the resource id to native cursor, or one of the values in NativeCursor |
Definition at line 95 of file cursor.cpp.
References FIFE::SharedPtr< T >::reset(), and setNativeCursor().
Referenced by Cursor(), and draw().

| void FIFE::Cursor::set | ( | ImagePtr | image | ) |
Sets the current mouse cursor type to image
| image | ImagePtr to a image used for the cursor |
Definition at line 107 of file cursor.cpp.
References FIFE::SharedPtr< T >::reset().
| void FIFE::Cursor::set | ( | AnimationPtr | anim | ) |
Sets the current mouse cursor type to animation
| anim | AnimationPtr to a loaded animation used for the cursor |
Definition at line 121 of file cursor.cpp.
References FIFE::TimeManager::getTime(), and FIFE::SharedPtr< T >::reset().
| void FIFE::Cursor::setDrag | ( | ImagePtr | image, |
| int32_t | drag_offset_x = 0, |
||
| int32_t | drag_offset_y = 0 |
||
| ) |
Sets the current drag image cursor
| image | ImagePtr to a image used for the drag |
Definition at line 136 of file cursor.cpp.
References FIFE::SharedPtr< T >::reset().
| void FIFE::Cursor::setDrag | ( | AnimationPtr | anim, |
| int32_t | drag_offset_x = 0, |
||
| int32_t | drag_offset_y = 0 |
||
| ) |
Sets the current drag animated cursor
| anim | AnimationPtr to a loaded animation used for the drag |
Definition at line 147 of file cursor.cpp.
References FIFE::TimeManager::getTime(), and FIFE::SharedPtr< T >::reset().
|
protected |
Sets the cursor to a native type.
| cursor_id | Resource id to native cursor, or one of the values in NativeCursor |
Definition at line 332 of file cursor.cpp.
References getNativeId().
Referenced by set().

| void FIFE::Cursor::setPosition | ( | uint32_t | x, |
| uint32_t | y | ||
| ) |
Set the mouse position
| x,y | The new position in screen coordinates |
Definition at line 171 of file cursor.cpp.