CreatePointer -- create a new mouse pointer (V4.0)
[id] = CreatePointer(id, type, ...)
[id] = CreatePointer(id, #SPRITE, srcid[, frame, spotx, spoty])
[id] = CreatePointer(id, #BRUSH, srcid[, spotx, spoty])
[id] = CreatePointer(id, #POINTER, ptrtype)
This function creates a new mouse pointer and assigns the identifier id to it. If you pass Nil in id, CreatePointer() will automatically choose an identifier and return it. The mouse pointer object created by this function can be displayed later by calling the SetPointer() function. Mouse pointers can be created either from a sprite or brush source, or you can choose a predefined mouse pointer. The calling convention of CreatePointer() depends on the type you specify as the second argument.

For the types #SPRITE and #BRUSH you have to specify the identifier of the object that shall be used as the source for the pointer graphics. The mouse pointer created by this function is independent of the source object, so you can free the source object after calling CreatePointer().

If you specify #POINTER as the type, you have to provide an additional argument that defines which predefined mouse pointer image you want to obtain. Currently, this can be #STDPTR_SYSTEM for the system's standard pointer and #STDPTR_BUSY for the system's standard wait pointer.

The spotx and spoty arguments specify the hot spot inside the mouse pointer. The hot spot is the mouse pointer's pixel that is used to click. If the mouse pointer image is an arrow, then the hot spot is usually exactly at the tip of the arrow. If you do not specify the spotx & spoty arguments, CreatePointer() will use the center of the image as the hot spot.

Please note that not all systems can handle true colour mouse pointers. If the system does not support true colour mouse pointers, Hollywood will reduce the colors. Also, your image data might get scaled because some systems impose limits on the maximum mouse pointer size.

On AmigaOS 3, CreatePointer() also supports palette brushes and sprites. Pointers on classic Amiga hardware are always palette-based because they are implemented using hardware sprites so if you pass palette brushes or sprites to CreatePointer() on AmigaOS 3 you have full control over the exact pens used by the pointer which is more convenient than using 32-bit graphics because those will first have to be mapped down to palette graphics on AmigaOS 3 and you won't have any control over the palette pens in the remapped brush or sprite.

id for the mouse pointer or Nil for auto id selection
type from which to take the source data
further arguments depend on the type specified (see above)
optional: identifier of the mouse pointer; will only be returned when you pass Nil as argument 1 (see above)
CreatePointer(1, #BRUSH, 2, 0, 0)
The code above creates a new mouse pointer 1 from the brush with the id 2. The hot spot will be at position 0:0 (i.e. the top-left corner of the image). After creating the mouse pointer it will be displayed using SetPointer().

Show TOC