Difference between revisions of "Object:type"

Line 2: Line 2:
  
 
== Function ==
 
== Function ==
 
 
=== Synopsis ===
 
=== Synopsis ===
 
<source lang="lua">
 
<source lang="lua">
Line 11: Line 10:
 
=== Returns ===
 
=== Returns ===
 
{{param|string|type|The type as a string.}}
 
{{param|string|type|The type as a string.}}
 
+
=== Examples ===
== 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")
Line 21: Line 17:
 
print(source:type()) -- outputs: Source
 
print(source:type()) -- outputs: Source
 
</source>
 
</source>
 
 
== See Also ==
 
== See Also ==
 
* [[parent::Object]]
 
* [[parent::Object]]
 
 
{{#set:Description=Gets the type of the object as a string.}}
 
{{#set:Description=Gets the type of the object as a string.}}
 +
{{#set:Since=000}}
 
[[Category:Functions]]
 
[[Category:Functions]]
 
== Other Languages ==
 
== Other Languages ==
 
{{i18n|Object:type}}
 
{{i18n|Object:type}}

Revision as of 09:20, 25 March 2011

Gets the type of the object as a string.

Function

Synopsis

type = Object:type()

Arguments

None.

Returns

string type
The type as a string.

Examples

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