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

m
m (acerto de links)
Line 7: Line 7:
 
</source>
 
</source>
 
=== Argumentos ===
 
=== Argumentos ===
{{param|string|tipo|O tipo objeto que se quer verificar.}}
+
{{param|string (Português)|tipo|O tipo objeto que se quer verificar.}}
 
=== Retornos ===
 
=== Retornos ===
{{param|boolean|b|True se o objeto é do tipo especificado, senão false.}}
+
{{param|boolean (Português)|b|True se o objeto é do tipo especificado, senão false.}}
  
 
== Exemplos ==
 
== Exemplos ==

Revision as of 07:57, 4 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 (Português) tipo
O tipo objeto que se quer verificar.

Retornos

boolean (Português) 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