Difference between revisions of "Talk:Tutorial:Using Input"

(Created page with 'Why <source lang="lua"> if key == 'h' then if love.mouse.isVisible() then love.mouse.setVisible(false) else love.mouse.setVisible(true) end end </source> and…')
 
Line 17: Line 17:
 
?
 
?
 
--[[User:Athaudia|Athaudia]] 13:56, 14 July 2010 (UTC)
 
--[[User:Athaudia|Athaudia]] 13:56, 14 July 2010 (UTC)
 +
 +
On a second thought, this is the tutorial section, so probably better to have it more verbose.
 +
--[[User:Athaudia|Athaudia]] 14:42, 14 July 2010 (UTC)

Revision as of 14:42, 14 July 2010

Why

if key == 'h' then
   if love.mouse.isVisible() then
      love.mouse.setVisible(false)
   else
      love.mouse.setVisible(true)
   end
end

and not

if key == 'h' then
   love.mouse.setVisible(not love.mouse.isVisible())
end

? --Athaudia 13:56, 14 July 2010 (UTC)

On a second thought, this is the tutorial section, so probably better to have it more verbose. --Athaudia 14:42, 14 July 2010 (UTC)