The methods of the Mouse class are used to hide and show the mouse pointer,
or to set the pointer to a specific style. The Mouse class is a top-level
class whose properties and methods you can access without using a
constructor.
Static variables
staticcursor:MouseCursor
Sets or returns the type of cursor, or, for a native cursor, the
cursor name.
The default value is openfl.ui.MouseCursor.AUTO
.
To set values for this property, use the following string values:
String value | Description |
---|---|
openfl.ui.MouseCursor.AUTO | Mouse cursor will change automatically based on the object under the mouse. |
openfl.ui.MouseCursor.ARROW | Mouse cursor will be an arrow. |
openfl.ui.MouseCursor.BUTTON | Mouse cursor will be a button clicking hand. |
openfl.ui.MouseCursor.HAND | Mouse cursor will be a dragging hand. |
openfl.ui.MouseCursor.IBEAM | Mouse cursor will be an I-beam. |
Note: For Flash Player 10.2 or AIR 2.6 and later versions, this
property sets or gets the cursor name when you are using a native
cursor. A native cursor name defined using Mouse.registerCursor()
overwrites currently predefined cursor types (such as
openfl.ui.MouseCursor.IBEAM
).
Throws:
ArgumentError | If set to any value which is not a member of
|
---|
staticread onlysupportsCursor:Bool = true
Indicates whether the computer or device displays a persistent cursor.
The supportsCursor
property is true
on most desktop computers and
false
on most mobile devices.
Note: Mouse events can be dispatched whether or not this property
is true
. However, mouse events may behave differently depending on
the physical characteristics of the pointing device.
staticread onlysupportsNativeCursor:Bool = true
Indicates whether the current configuration supports native cursors.
Static methods
statichide():Void
Hides the pointer. The pointer is visible by default.
Note: You need to call Mouse.hide()
only once,
regardless of the number of previous calls to
Mouse.show()
.
staticshow():Void
Displays the pointer. The pointer is visible by default.
Note: You need to call Mouse.show()
only once,
regardless of the number of previous calls to
Mouse.hide()
.