Product Home Class IndexDownload

CK_Cursor

CK_Object
   |
   +----CK_Cursor

A CK_Cursor object represents a custom cursor.  It has an image, which may or may not be animated, and a hotspot.  Cursors must be 64x64 pixels or less in size.


Constructors

CK_Cursor(CK_Bitmap *bitmap, int hotspotX, int hotspotY)
Constructs a CK_Cursor object having the given bitmap and hotspot.
 

Public Methods

exchangeBitmap
Sets a new bitmap for the cursor and returns the old.
getBitmap
Returns a const pointer to the cursor's bitmap.
getHotspot
Gets the x,y coordinates of the hotspot.
getPaletteIndex
Returns the current palette index of the bitmap.  This only applies if the bitmap is 8 bits/pixel.
setPaletteIndex
Selects the palette to be displayed for the cursor's bitmap.
updateHotspot
Changes the hotspot of the cursor.

Creates a cursor object having the specified bitmap and hotspot.  The CK_Cursor   takes ownership of the bitmap.  When the cursor object is deleted, it also deletes it's bitmap.  Cursors must be 64x64 pixels or less in size.

Parameters

bitmap
This can be a CK_StaticBitmap or a CK_Animation.  If the bitmap is 8 bits/pixel, it can have multiple palettes.
hotspotX
The X coordinate of the cursor's hotspot.
hotspotY
The Y coordinate of the cursor's hotspot.

Sets a new bitmap for the cursor and returns the old.  The CK_Cursor object no longer owns the bitmap returned, and takes ownership of the new bitmap. Cursors must be 64x64 pixels or less in size.

Return Value
Returns a pointer to the old bitmap.

Parameters

newBitmap
This can be a CK_StaticBitmap or a CK_Animation.  If the bitmap is 8 bits/pixel, it can have multiple palettes.

Returns a const pointer to the cursor's bitmap.  A const pointer is returned because the cursor owns the bitmap and we don't  want the application to be able to delete the bitmap.

Returns the x,y coordinates of the cursor's hotspot.

Parameters

x
A reference to an integer variable that will receive the x-coordinate of the hotspot.
y
A reference to an integer variable that will receive the y-coordinate of the hotspot.

Returns the index of the palette to be used when drawing the cursor.  This only applies if the bitmap is 8-bits per pixel and contains multiple palettes.

Selects the palette to be used when displaying the cursor.  This only applies if the bitmap is 8-bits per pixel and contains multiple palettes. 

Parameters

index
The index of the palette in the bitmap to be used.

Sets a new hotspot for the cursor.

Parameters

x
The new x-coordinate of the hotspot.
y
The new y-coordinate of the hotspot.