Difference between revisions of "love.getVersion"
(Created page) |
m (→See Also) |
||
(8 intermediate revisions by 3 users not shown) | |||
Line 13: | Line 13: | ||
{{param|number|minor|The minor version of LÖVE, i.e. 9 for version 0.9.1.}} | {{param|number|minor|The minor version of LÖVE, i.e. 9 for version 0.9.1.}} | ||
{{param|number|revision|The revision version of LÖVE, i.e. 1 for version 0.9.1.}} | {{param|number|revision|The revision version of LÖVE, i.e. 1 for version 0.9.1.}} | ||
− | {{param|string|codename|The codename of the current version.}} | + | {{param|string|codename|The codename of the current version, i.e. "Baby Inspector" for version 0.9.1.}} |
+ | |||
+ | == Notes == | ||
+ | For LÖVE versions below 0.9.1, the following variables can be used instead (and still work in 0.9.2 and newer): | ||
+ | <source lang="lua"> | ||
+ | love._version_major | ||
+ | love._version_minor | ||
+ | love._version_revision | ||
+ | </source> | ||
+ | |||
+ | == Examples == | ||
+ | === display the current version === | ||
+ | <source lang="lua"> | ||
+ | function love.draw() | ||
+ | local major, minor, revision, codename = love.getVersion() | ||
+ | local str = string.format("Version %d.%d.%d - %s", major, minor, revision, codename) | ||
+ | love.graphics.print(str, 20, 20) | ||
+ | end | ||
+ | </source> | ||
== See Also == | == See Also == | ||
* [[parent::love]] | * [[parent::love]] | ||
+ | * [[love.isVersionCompatible]] | ||
[[Category:Functions]] | [[Category:Functions]] | ||
{{#set:Description=Gets the current running version of LÖVE.}} | {{#set:Description=Gets the current running version of LÖVE.}} | ||
+ | |||
== Other Languages == | == Other Languages == | ||
{{i18n|love.getVersion}} | {{i18n|love.getVersion}} |
Latest revision as of 13:36, 22 April 2019
Available since LÖVE 0.9.1 |
This function is not supported in earlier versions. |
Gets the current running version of LÖVE.
Contents
Function
Synopsis
major, minor, revision, codename = love.getVersion( )
Arguments
None.
Returns
number major
- The major version of LÖVE, i.e. 0 for version 0.9.1.
number minor
- The minor version of LÖVE, i.e. 9 for version 0.9.1.
number revision
- The revision version of LÖVE, i.e. 1 for version 0.9.1.
string codename
- The codename of the current version, i.e. "Baby Inspector" for version 0.9.1.
Notes
For LÖVE versions below 0.9.1, the following variables can be used instead (and still work in 0.9.2 and newer):
love._version_major
love._version_minor
love._version_revision
Examples
display the current version
function love.draw()
local major, minor, revision, codename = love.getVersion()
local str = string.format("Version %d.%d.%d - %s", major, minor, revision, codename)
love.graphics.print(str, 20, 20)
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