Difference between revisions of "love.mouse.isVisible"

 
(Add an example, see also)
 
(5 intermediate revisions by 3 users not shown)
Line 1: Line 1:
 
+
Checks if the cursor is visible.
 
 
 
== Function ==
 
== Function ==
 
=== Synopsis ===
 
=== Synopsis ===
Line 10: 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=}}
+
{{#set:Description=Checks if the cursor is visible.}}
 +
{{#set:Since=000}}
 +
== Other Languages ==
 +
{{i18n|love.mouse.isVisible}}

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