Difference between revisions of "love.mousefocus"
m |
m |
||
(4 intermediate revisions by 3 users not shown) | |||
Line 4: | Line 4: | ||
=== Synopsis === | === Synopsis === | ||
<source lang="lua"> | <source lang="lua"> | ||
− | love.mousefocus( | + | love.mousefocus( focus ) |
</source> | </source> | ||
=== Arguments === | === Arguments === | ||
− | {{param|boolean| | + | {{param|boolean|focus|Whether the window has mouse focus or not.}} |
=== Returns === | === Returns === | ||
Nothing. | Nothing. | ||
Line 36: | Line 36: | ||
[[Category:Callbacks]] | [[Category:Callbacks]] | ||
{{#set:Description=Callback function triggered when window receives or loses mouse focus.}} | {{#set:Description=Callback function triggered when window receives or loses mouse focus.}} | ||
− | {{#set:Subcategory= | + | {{#set:Subcategory=Window}} |
== Other Languages == | == Other Languages == | ||
{{i18n|love.mousefocus}} | {{i18n|love.mousefocus}} |
Latest revision as of 22:29, 7 March 2019
Available since LÖVE 0.9.0 |
This callback is not supported in earlier versions. |
Callback function triggered when window receives or loses mouse focus.
Function
Synopsis
love.mousefocus( focus )
Arguments
boolean focus
- Whether the window has mouse focus or not.
Returns
Nothing.
Example
function love.load()
text = "Mouse is in the window!"
end
function love.draw()
love.graphics.print(text,0,0)
end
function love.mousefocus(f)
if not f then
text = "Mouse is not in the window!"
print("LOST MOUSE FOCUS")
else
text = "Mouse is in the window!"
print("GAINED MOUSE FOCUS")
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