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

m
m
Line 9: Line 9:
 
{{param|string|tipo|O tipo objeto que se quer verificar.}}
 
{{param|string|tipo|O tipo objeto que se quer verificar.}}
 
=== Retornos ===
 
=== Retornos ===
{{param|boolean|b|True se o objeto é do tipo especificado, se não false.}}
+
{{param|boolean|b|True se o objeto é do tipo especificado, senão false.}}
  
 
== Exemplos ==
 
== Exemplos ==

Revision as of 10:29, 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.

Retornos

boolean b
True se o objeto é do tipo especificado, senã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