Difference between revisions of "Object:typeOf (Français)"
(Début de la traduction FR) |
|||
Line 1: | Line 1: | ||
− | + | Teste si un objet est du type spécifié. Si c'est le cas, cette fonction retourne <code>true</code>, sinon elle retourne <code>false</code>. | |
− | |||
− | Si | ||
== Fonction == | == Fonction == | ||
− | |||
=== Synopsis === | === Synopsis === | ||
<source lang="lua"> | <source lang="lua"> | ||
Line 10: | Line 7: | ||
</source> | </source> | ||
=== Arguments === | === Arguments === | ||
− | {{param|string|name| | + | {{param|string|name|Nom du type pour le test.}} |
=== Retour === | === Retour === | ||
− | {{param|boolean|b|<code>true</code> si l'objet est du type spécifié, | + | {{param|boolean|b|<code>true</code> si l'objet est du type spécifié, <code>false</code> sinon.}} |
− | |||
== Exemples == | == Exemples == | ||
− | + | === Vérifier le type d'un objet === | |
− | === | ||
<source lang="lua"> | <source lang="lua"> | ||
image = love.graphics.newImage("test.png") | image = love.graphics.newImage("test.png") | ||
Line 24: | Line 19: | ||
print(image:typeOf("MouseJoint")) -- affiche: false | print(image:typeOf("MouseJoint")) -- affiche: false | ||
</source> | </source> | ||
− | + | == Voir Egalement == | |
− | == Voir | ||
* [[parent::Object (Français)]] | * [[parent::Object (Français)]] | ||
− | |||
{{#set:Description=Test si un objet est d'un certain type.}} | {{#set:Description=Test si un objet est d'un certain type.}} | ||
[[Category:Functions]] | [[Category:Functions]] | ||
− | + | == Autres Langages == | |
− | == Autres | ||
{{i18n|Object:typeOf}} | {{i18n|Object:typeOf}} |
Revision as of 21:14, 10 August 2017
Teste si un objet est du type spécifié. Si c'est le cas, cette fonction retourne true
, sinon elle retourne false
.
Contents
Fonction
Synopsis
b = Object:typeOf( name )
Arguments
string name
- Nom du type pour le test.
Retour
boolean b
true
si l'objet est du type spécifié,false
sinon.
Exemples
Vérifier le type d'un objet
image = love.graphics.newImage("test.png")
print(image:typeOf("Object")) -- affiche: true
print(image:typeOf("Drawable")) -- affiche: true
print(image:typeOf("Image")) -- affiche: true
print(image:typeOf("MouseJoint")) -- affiche: false
Voir Egalement
Autres Langages
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