FIFE  2008.0
 All Classes Namespaces Functions Variables Enumerations Enumerator Pages
FIFE::Cursor Class Reference

#include <cursor.h>

Collaboration diagram for FIFE::Cursor:
Collaboration graph

List of all members.

Public Member Functions

 Cursor (ImagePool *imgpool, AnimationPool *animpool, RenderBackend *renderbackend)
virtual ~Cursor ()
virtual void draw ()
void set (MouseCursorType ctype, unsigned int cursor_id=0)
void setDrag (MouseCursorType ctype, unsigned int drag_id=0, int drag_offset_x=0, int drag_offset_y=0)
MouseCursorType getType () const
unsigned int getId () const
MouseCursorType getDragType () const
unsigned int getDragId () const
unsigned int getX () const
unsigned int getY () const

Protected Member Functions

void setNativeCursor (unsigned int cursor_id)
unsigned int getNativeId (unsigned int cursor_id)

Detailed Description

Cursor class manages mouse cursor handling

Definition at line 84 of file cursor.h.


Constructor & Destructor Documentation

FIFE::Cursor::Cursor ( ImagePool imgpool,
AnimationPool animpool,
RenderBackend renderbackend 
)

Constructor.

Definition at line 77 of file cursor.cpp.

virtual FIFE::Cursor::~Cursor ( )
inlinevirtual

Destructor.

Definition at line 92 of file cursor.h.


Member Function Documentation

void FIFE::Cursor::draw ( )
virtual

draws cursor on screen

Definition at line 145 of file cursor.cpp.

References FIFE::Animation::getDuration(), FIFE::Animation::getFrameByTimestamp(), FIFE::TimeManager::getTime(), and FIFE::Image::render().

Referenced by FIFE::Engine::pump().

Here is the caller graph for this function:

unsigned int FIFE::Cursor::getDragId ( ) const
inline

Gets the current mouse cursor pool id

Definition at line 127 of file cursor.h.

MouseCursorType FIFE::Cursor::getDragType ( ) const
inline

Gets the current mouse cursor type

Definition at line 123 of file cursor.h.

unsigned int FIFE::Cursor::getId ( ) const
inline

Gets the current mouse cursor pool id

Definition at line 119 of file cursor.h.

unsigned int FIFE::Cursor::getNativeId ( unsigned int  cursor_id)
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.

Parameters:
Oneof the values in NativeCursor

Definition at line 188 of file cursor.cpp.

Referenced by setNativeCursor().

Here is the caller graph for this function:

MouseCursorType FIFE::Cursor::getType ( ) const
inline

Gets the current mouse cursor type

Definition at line 115 of file cursor.h.

unsigned int FIFE::Cursor::getX ( ) const
inline

Gets the current mouse x position

Definition at line 131 of file cursor.h.

unsigned int FIFE::Cursor::getY ( ) const
inline

Gets the current mouse y position

Definition at line 135 of file cursor.h.

void FIFE::Cursor::set ( MouseCursorType  ctype,
unsigned int  cursor_id = 0 
)

Sets the current mouse cursor type and possible pool value

Parameters:
ctypecursor type
cursor_idPool id to image or animation. For native cursors, this is the resource id to native cursor, or one of the values in NativeCursor

Definition at line 98 of file cursor.cpp.

References FIFE::TimeManager::getTime(), and setNativeCursor().

void FIFE::Cursor::setDrag ( MouseCursorType  ctype,
unsigned int  drag_id = 0,
int  drag_offset_x = 0,
int  drag_offset_y = 0 
)

Sets the current drag cursor type and pool value

Parameters:
ctypedrag cursor type
drag_idpool id for the drag cursor (either image or animation)
drag_offsetoffset of drag image shown with cursor

Definition at line 122 of file cursor.cpp.

References FIFE::TimeManager::getTime().

void FIFE::Cursor::setNativeCursor ( unsigned int  cursor_id)
protected

Sets the cursor to a native type.

Parameters:
cursor_idResource id to native cursor, or one of the values in NativeCursor

Definition at line 276 of file cursor.cpp.

References getNativeId().

Referenced by set().

Here is the caller graph for this function:


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