Difference between revisions of "love.mouse.isVisible"
(Add an example, see also) |
|||
Line 9: | Line 9: | ||
=== Returns === | === Returns === | ||
{{param|boolean|visible|True if the cursor to visible, false if the cursor is hidden.}} | {{param|boolean|visible|True if the cursor to visible, false if the cursor is hidden.}} | ||
+ | == Examples == | ||
+ | Toggle mouse visibility by pressing tab (using [[love.mouse.setVisible|setVisible]]). | ||
+ | <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.setVisible]] | ||
[[Category:Functions]] | [[Category:Functions]] | ||
{{#set:Description=Checks if the cursor is visible.}} | {{#set:Description=Checks if the cursor is visible.}} |
Latest revision as of 13:56, 27 September 2011
Checks if the cursor is visible.
Function
Synopsis
visible = love.mouse.isVisible( )
Arguments
None.
Returns
boolean visible
- True if the cursor to visible, false if the cursor is hidden.
Examples
Toggle mouse visibility by pressing tab (using setVisible).
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