Difference between revisions of "Object:type"
Antoniomoder (talk | contribs) |
(Move example to example section) |
||
Line 1: | Line 1: | ||
Gets the type of the object as a string. | Gets the type of the object as a string. | ||
− | |||
− | |||
− | |||
− | |||
− | |||
== Function == | == Function == | ||
=== Synopsis === | === Synopsis === | ||
Line 21: | Line 16: | ||
source = love.audio.newSource("test.ogg") | source = love.audio.newSource("test.ogg") | ||
print(source:type()) -- outputs: Source | print(source:type()) -- outputs: Source | ||
+ | </source> | ||
+ | |||
+ | An alternate way of printing the type: | ||
+ | <source lang="lua"> | ||
+ | type = tostring(Object) | ||
</source> | </source> | ||
== See Also == | == See Also == |
Revision as of 13:38, 28 July 2015
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
An alternate way of printing the type:
type = tostring(Object)
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