Difference between revisions of "love.mouse.setVisible"
m (1 revision: Imported docs from potato.) |
(Add an example, see also) |
||
(4 intermediate revisions by 3 users not shown) | |||
Line 1: | Line 1: | ||
− | + | Sets the current visibility of the cursor. | |
− | |||
== Function == | == Function == | ||
=== Synopsis === | === Synopsis === | ||
Line 10: | Line 9: | ||
=== Returns === | === Returns === | ||
Nothing. | Nothing. | ||
+ | == Examples == | ||
+ | Toggle mouse visibility by pressing tab. | ||
+ | <source lang="lua"> | ||
+ | function love.keypressed(key) | ||
+ | if key == "tab" then | ||
+ | local state = not love.mouse.isVisible() -- the opposite of whatever it currently is | ||
+ | love.mouse.setVisible(state) | ||
+ | end | ||
+ | end | ||
+ | </source> | ||
== See Also == | == See Also == | ||
* [[parent::love.mouse]] | * [[parent::love.mouse]] | ||
+ | * [[love.mouse.isVisible]] | ||
[[Category:Functions]] | [[Category:Functions]] | ||
− | {{#set:Description=}} | + | {{#set:Description=Sets the current visibility of the cursor.}} |
+ | {{#set:Since=000}} | ||
+ | == Other Languages == | ||
+ | {{i18n|love.mouse.setVisible}} |
Latest revision as of 13:55, 27 September 2011
Sets the current visibility of the cursor.
Function
Synopsis
love.mouse.setVisible( visible )
Arguments
boolean visible
- True to set the cursor to visible, false to hide the cursor.
Returns
Nothing.
Examples
Toggle mouse visibility by pressing tab.
function love.keypressed(key)
if key == "tab" then
local state = not love.mouse.isVisible() -- the opposite of whatever it currently is
love.mouse.setVisible(state)
end
end
See Also
Other Languages
Dansk –
Deutsch –
English –
Español –
Français –
Indonesia –
Italiano –
Lietuviškai –
Magyar –
Nederlands –
Polski –
Português –
Română –
Slovenský –
Suomi –
Svenska –
Türkçe –
Česky –
Ελληνικά –
Български –
Русский –
Српски –
Українська –
עברית –
ไทย –
日本語 –
正體中文 –
简体中文 –
Tiếng Việt –
한국어
More info