Difference between revisions of "love.mouse.isGrabbed (简体中文)"

(鼠标)
 
m (鼠标)
 
Line 25: Line 25:
 
{{#set:Description=检测鼠标是否被限制.}}
 
{{#set:Description=检测鼠标是否被限制.}}
 
{{#set:Since=000}}
 
{{#set:Since=000}}
== Other Languages ==
+
== 多国语言 ==
 
{{i18n|love.mouse.isGrabbed}}
 
{{i18n|love.mouse.isGrabbed}}

Latest revision as of 03:50, 17 March 2013

返回鼠标是否被限制的状态.

函数来啦

例子

grabbed = love.mouse.isGrabbed( )

米有参数

米有米有米有米有米有 >_<

返回值

boolean grabbed
被限制了就是true,不然就是false..

实例来了

通过使用Tab键改变鼠标的限制属性,这里会用到love.mouse.setGrab (简体中文).

function love.keypressed(key)
   if key == "tab" then
      local state = not love.mouse.isGrabbed() -- 赋予state目前状态相反的值
      love.mouse.setGrab(state) --改变鼠标限制状态
   end
end

顺便看看


多国语言