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. | + | 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( | + | b = Object:typeOf( nome ) |
</source> | </source> | ||
=== Argumentos === | === Argumentos === | ||
− | {{param|string| | + | {{param|string (Português)|nome|O nome do tipo a ser verificado.}} |
− | === | + | === Retorna === |
− | {{param|boolean|b| | + | {{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 === | |
− | === | ||
<source lang="lua"> | <source lang="lua"> | ||
− | + | imagem = love.graphics.newImage("teste.png") | |
− | print( | + | print(imagem:typeOf("Object")) -- retorna: true |
− | print( | + | print(imagem:typeOf("Drawable")) -- retorna: true |
− | print( | + | print(imagem:typeOf("Image")) -- retorna: true |
− | print( | + | 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.
Contents
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
Dansk –
Deutsch –
English –
Español –
Français –
Indonesia –
Italiano –
Lietuviškai –
Magyar –
Nederlands –
Polski –
Português –
Română –
Slovenský –
Suomi –
Svenska –
Türkçe –
Česky –
Ελληνικά –
Български –
Русский –
Српски –
Українська –
עברית –
ไทย –
日本語 –
正體中文 –
简体中文 –
Tiếng Việt –
한국어
More info