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

(Created page with '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 === <s…')
 
Line 6: Line 6:
 
b = Object:typeOf( tipo )
 
b = Object:typeOf( tipo )
 
</source>
 
</source>
=== Argument0s ===
+
=== Argumentos ===
 
{{param|string|tipo|O tipo objeto que se quer verificar.}}
 
{{param|string|tipo|O tipo objeto que se quer verificar.}}
 
=== Returnos ===
 
=== Returnos ===

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

Outras Línguas