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

m
m (translation update)
 
(3 intermediate revisions by one other user not shown)
Line 1: Line 1:
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.
+
Verifica se um objeto é de um certo tipo. Se a função tem o tipo com o nome especificado em sua hierarquia, esta função retornará verdadeiro.
  
 
== Função ==
 
== Função ==
 
=== Sinopse ===
 
=== Sinopse ===
 
<source lang="lua">
 
<source lang="lua">
b = Object:typeOf( tipo )
+
b = Object:typeOf( nome )
 
</source>
 
</source>
 
=== Argumentos ===
 
=== Argumentos ===
{{param|string|tipo|O tipo objeto que se quer verificar.}}
+
{{param|string (Português)|nome|O nome do tipo a ser verificado.}}
=== Retornos ===
+
=== Retorna ===
{{param|boolean|b|True se o objeto é do tipo especificado, se não false.}}
+
{{param|boolean (Português)|b|Verdadeiro se o objeto for do tipo especificado; se não, falso.}}
 
 
 
== Exemplos ==
 
== Exemplos ==
 
+
=== Verificar o tipo de um objeto ===
=== Verificando o tipo de um objeto ===
 
 
<source lang="lua">
 
<source lang="lua">
image = love.graphics.newImage("test.png")
+
imagem = love.graphics.newImage("teste.png")
print(image:typeOf("Object")) -- saída: true
+
print(imagem:typeOf("Object")) -- retorna: true
print(image:typeOf("Drawable")) -- saída: true
+
print(imagem:typeOf("Drawable")) -- retorna: true
print(image:typeOf("Image")) -- saída: true
+
print(imagem:typeOf("Image")) -- retorna: true
print(image:typeOf("MouseJoint")) -- saída: false
+
print(imagem:typeOf("MouseJoint")) -- retorna: false
 
</source>
 
</source>
 
 
== Veja Também ==
 
== Veja Também ==
 
* [[parent::Object (Português)]]
 
* [[parent::Object (Português)]]
 
{{#set:Description=Verifica se um objeto é de um certo tipo.}}
 
{{#set:Description=Verifica se um objeto é de um certo tipo.}}
 +
{{#set:Since=000}}
 
[[Category:Functions]]
 
[[Category:Functions]]
 
 
== Outros Idiomas ==
 
== Outros Idiomas ==
 
{{i18n|Object:typeOf}}
 
{{i18n|Object:typeOf}}

Latest revision as of 00:49, 6 March 2014

Verifica se um objeto é de um certo tipo. Se a função tem o tipo com o nome especificado em sua hierarquia, esta função retornará verdadeiro.

Função

Sinopse

b = Object:typeOf( nome )

Argumentos

string (Português) nome
O nome do tipo a ser verificado.

Retorna

boolean (Português) b
Verdadeiro se o objeto for do tipo especificado; se não, falso.

Exemplos

Verificar o tipo de um objeto

imagem = love.graphics.newImage("teste.png")
print(imagem:typeOf("Object")) -- retorna: true
print(imagem:typeOf("Drawable")) -- retorna: true
print(imagem:typeOf("Image")) -- retorna: true
print(imagem:typeOf("MouseJoint")) -- retorna: false

Veja Também

Outros Idiomas