Lingo Dictionary > A-C > cursor (command) |  |

cursor (command)

Syntax

    cursor [castNumber, maskCastNumber]
    cursor whichCursor
    cursor (member whichCursorCastMember)

Description

Command; changes the cast member or built-in cursor that is used for a cursor and stays in effect until you turn it off by setting the cursor to 0.

| Use the syntax `cursor [``castNumber``,` `maskCastNumber``]` to specify the number of a cast member to use as a cursor and its optional mask. The cursor's hot spot is the registration point of the cast member.
| The cast member that you specify must be a 1-bit cast member. If the cast member is larger than 16 by 16 pixels, Director crops it to a 16-by-16-pixel square, starting in the upper left corner of the image. The cursor's hot spot is still the registration point of the cast member.
| Use the syntax `cursor` `whichCursor` to specify default system cursors. The term `whichCursor` must be one of the following integer values:

`0` | No cursor set
`-1` | Arrow (pointer) cursor
`1` | I-beam cursor
`2` | Crosshair cursor
`3*` | Crossbar cursor
`4` | Watch cursor (Macintosh only)
`200` | Blank cursor (hides cursor)

| Use the syntax `cursor (member` `whichCursorCastMember``)` for the custom cursors available through the Cursor Xtra.

Be sure not to confuse the syntax `cursor 1` with `cursor [1]`. The first selects the I-beam from the system cursor set; the second uses cast member 1 as the custom cursor.

Note: Although the Cursor Xtra allows cursors of different cast types, text cast members cannot be used as cursors.

During system events such as file loading, the operating system may display the watch cursor and then change to the pointer cursor when returning control to the application, overriding the `cursor` command settings from the previous movie. To use `cursor` at the beginning of any new movie that is loaded in a presentation using a custom cursor for multiple movies, store any special cursor resource number as a global variable that remains in memory between movies.

Cursor commands can be interrupted by an Xtra or other external agent. If the cursor is set to a value in Director and an Xtra or external agent takes control of the cursor, resetting the cursor to the original value has no effect because Director doesn't perceive that the cursor has changed. To work around this, explicitly set the cursor to a third value and then reset it to the original value.

Example

This statement changes the cursor to a watch cursor on the Macintosh, and hourglass in Windows, whenever the value in the variable named status equals 1:

    if status = 1 then cursor 4

This handler checks whether the cast member assigned to the variable is a 1-bit cast member and then uses it as the cursor if it is:

    on myCursor someMember
    	if the depth of member someMember = 1 then
    		cursor[someMember]
    			else
    		beep
    	end if
    end

See also

`cursor (sprite property)`, `rollOver()`