Logo Search packages:      
Sourcecode: freecraft version File versions  Download package

_cursor_type_ Struct Reference

#include <cursor.h>

List of all members.

Detailed Description

Private type which specifies the cursor-type.

#include "cursor.h"

typedef struct _cursor_type_ CursorType;

This structure contains all informations about a cursor. The cursor changes depending of the current user input state. A cursor can have transparent areas and color cycle animated.

In the future it is planned to support animated cursors.

The cursor-type structure members:


Object type (future extensions).


Unique identifier of the cursor, used to reference it in config files and during startup. Don't use this in game, use instead the pointer to this structure.


Owning Race of this cursor ("human", "orc", "alliance", "mythical", ...). If NULL, this cursor could be used by any race.


File containing the image graphics of the cursor.

CursorType::HotX CursorType::HotY

Hot spot of the cursor in pixels. Relative to the sprite origin (0,0). The hot spot of a cursor is the point to which FreeCraft refers in tracking the cursor's position.

CursorType::Width CursorType::Height

Size of the cursor in pixels.


Current displayed cursor frame. From 0 to CursorType::Graphic::NumFrames.


Rate of changing the frames. The "rate" tells the engine how many milliseconds to hold each frame of the animation.

This is the first time that for timing ms are used! I would change it to display frames.

Contains the sprite of the cursor, loaded from CursorType::File. This can be a multicolor image with alpha or transparency.

Definition at line 134 of file cursor.h.

Public Attributes

char * File
 Race name.
int FrameRate
 Current displayed cursor frame.
int Height
 Width of cursor.
int HotX
 Graphic file of the cursor.
int HotY
 Hot point x.
char * Ident
 Object type (future extensions).
const void * OType
char * Race
 Identifier to reference it.
 Rate of changing the frames.
int SpriteFrame
 Height of cursor.
int Width
 Hot point y.

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

Generated by  Doxygen 1.6.0   Back to index