Difference between revisions of "Object:type"

(Undo revision 12105 by Gim (talk))
Line 1: Line 1:
 
Gets the type of the object as a string.
 
Gets the type of the object as a string.
  
 +
Note. Also, to get the type of object, you can use:
 +
<source lang="lua">
 +
type = tostring(Object)
 +
</source>
 
== Function ==
 
== Function ==
 
=== Synopsis ===
 
=== Synopsis ===

Revision as of 04:40, 26 July 2015

Gets the type of the object as a string.

Note. Also, to get the type of object, you can use:

type = tostring(Object)

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