Difference between revisions of "Object:typeOf (Português)"

Line 27: Line 27:
 
[[Category:Functions]]
 
[[Category:Functions]]
  
== Outras Línguas ==
+
== Outros Idiomas ==
 
{{i18n|Object:typeOf}}
 
{{i18n|Object:typeOf}}

Revision as of 10:20, 2 January 2011

Verifica se um objeto é de um certo tipo. If the object has the type with the specified name in its hierarchy, this function will return true.

Função

Sinopse

b = Object:typeOf( tipo )

Argumentos

string tipo
O tipo objeto que se quer verificar.

Returnos

boolean b
True se o objeto é do tipo especificado, se não false.

Exemplos

Verificando o tipo de um objeto

image = love.graphics.newImage("test.png")
print(image:typeOf("Object")) -- saída: true
print(image:typeOf("Drawable")) -- saída: true
print(image:typeOf("Image")) -- saída: true
print(image:typeOf("MouseJoint")) -- saída: false

Veja Também

Outros Idiomas