Squirrel/Client/Functions/Controls/ShowMouseCursor
From Liberty Unleashed Wiki
(Difference between revisions)
m (Updated related functions) |
(Added example) |
||
Line 12: | Line 12: | ||
== Example == | == Example == | ||
− | + | This code shows the mouse when the player uses the command '/mouse' | |
− | + | ||
<code lang="squirrel"> | <code lang="squirrel"> | ||
− | + | function onClientCommand(cmd, text) | |
+ | { | ||
+ | if(cmd == "mouse") | ||
+ | { | ||
+ | ShowMouseCursor( true ); | ||
+ | } | ||
+ | } | ||
</code> | </code> | ||
=== Notes === | === Notes === | ||
− | + | The event [[Squirrel/Client/Events/Player/onClientCommand|onClientCommand]] was used in this example. More information is available on the corresponding page. | |
== Related Functions == | == Related Functions == | ||
{{Squirrel/Client/Functions/Controls}} | {{Squirrel/Client/Functions/Controls}} |
Latest revision as of 22:52, 2 August 2011
This function sets the mouse cursor to show/hide
[edit] Syntax
ShowMouseCursor( bool b )
[edit] Arguments
- b - A boolean value stating if the mouse cursor should be shown
[edit] Example
This code shows the mouse when the player uses the command '/mouse'
function onClientCommand(cmd, text) { if(cmd == "mouse") { ShowMouseCursor( true ); } }
[edit] Notes
The event onClientCommand was used in this example. More information is available on the corresponding page.