Difference between revisions of "love.resize"
m |
m |
||
(2 intermediate revisions by 2 users not shown) | |||
Line 7: | Line 7: | ||
</source> | </source> | ||
=== Arguments === | === Arguments === | ||
− | {{param|number|w|The new width | + | {{param|number|w|The new width.}} |
− | {{param|number|h|The new height | + | {{param|number|h|The new height.}} |
=== Returns === | === Returns === | ||
Nothing. | Nothing. | ||
== Notes == | == Notes == | ||
Calls to <code>love.window.setMode</code> will '''only''' trigger this event if the width or height of the window after the call doesn't match the requested width and height. This can happen if a fullscreen mode is requested which doesn't match any supported mode, or if the fullscreen type is [[FullscreenType|'desktop']] and the requested width or height don't match the desktop resolution. | Calls to <code>love.window.setMode</code> will '''only''' trigger this event if the width or height of the window after the call doesn't match the requested width and height. This can happen if a fullscreen mode is requested which doesn't match any supported mode, or if the fullscreen type is [[FullscreenType|'desktop']] and the requested width or height don't match the desktop resolution. | ||
+ | |||
+ | Since [[11.0]], this function returns width and height in DPI-scaled units rather than pixels. | ||
== Example == | == Example == | ||
<source lang="lua"> | <source lang="lua"> | ||
Line 23: | Line 25: | ||
* [[love.window.setMode]] | * [[love.window.setMode]] | ||
* [[love.window.setFullscreen]] | * [[love.window.setFullscreen]] | ||
+ | * [[love.conf]] | ||
[[Category:Callbacks]] | [[Category:Callbacks]] | ||
{{#set:Description=Called when the window is resized.}} | {{#set:Description=Called when the window is resized.}} | ||
− | {{#set:Subcategory= | + | {{#set:Subcategory=Window}} |
== Other Languages == | == Other Languages == | ||
{{i18n|love.resize}} | {{i18n|love.resize}} |
Latest revision as of 22:31, 7 March 2019
Available since LÖVE 0.9.0 |
This callback is not supported in earlier versions. |
Called when the window is resized, for example if the user resizes the window, or if love.window.setMode
is called with an unsupported width or height in fullscreen and the window chooses the closest appropriate size.
Contents
Function
Synopsis
love.resize( w, h )
Arguments
Returns
Nothing.
Notes
Calls to love.window.setMode
will only trigger this event if the width or height of the window after the call doesn't match the requested width and height. This can happen if a fullscreen mode is requested which doesn't match any supported mode, or if the fullscreen type is 'desktop' and the requested width or height don't match the desktop resolution.
Since 11.0, this function returns width and height in DPI-scaled units rather than pixels.
Example
function love.resize(w, h)
print(("Window resized to width: %d and height: %d."):format(w, h))
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