Difference between revisions of "Object:type"
Line 1: | Line 1: | ||
+ | Gets the type of the object as a string. | ||
− | + | == Function == | |
− | == | + | === Synopsis === |
− | === | ||
<source lang="lua"> | <source lang="lua"> | ||
type = Object:type() | type = Object:type() | ||
</source> | </source> | ||
− | === | + | === Arguments === |
− | + | None. | |
− | === | + | === Returns === |
− | {{param|string|type| | + | {{param|string|type|The type as a string.}} |
− | == | + | == Examples == |
− | === | + | === Printing the type of an object === |
<source lang="lua"> | <source lang="lua"> | ||
image = love.graphics.newImage("test.png") | image = love.graphics.newImage("test.png") | ||
− | print(image:type()) -- | + | print(image:type()) -- outputs: Image |
source = love.audio.newSource("test.ogg") | source = love.audio.newSource("test.ogg") | ||
− | print(source:type()) -- | + | print(source:type()) -- outputs: Source |
</source> | </source> | ||
− | == | + | == See Also == |
− | * [[parent:: | + | * [[parent::Object]] |
− | {{#set:Description= | + | {{#set:Description=Gets the type of the object as a string.}} |
{{#set:Since=000}} | {{#set:Since=000}} | ||
[[Category:Functions]] | [[Category:Functions]] | ||
− | == | + | == Other Languages == |
{{i18n|Object:type}} | {{i18n|Object:type}} |
Revision as of 10:13, 14 November 2012
Gets the type of the object as a string.
Contents
Function
Synopsis
type = Object:type()
Arguments
None.
Returns
string type
- The type as a string.
Examples
Printing the type of an object
image = love.graphics.newImage("test.png")
print(image:type()) -- outputs: Image
source = love.audio.newSource("test.ogg")
print(source:type()) -- outputs: Source
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