Difference between revisions of "Object:typeOf (日本語)"

(New translation (Based revision : 11 December 2013, at 19:07))
 
m
 
Line 25: Line 25:
 
[[Category:Functions]]
 
[[Category:Functions]]
 
== そのほかの言語 ==
 
== そのほかの言語 ==
{{i18n|Object:typeOf}}
+
{{i18n (日本語)|Object:typeOf}}

Latest revision as of 07:51, 6 June 2019

オブジェクトが特定の種類かどうか確認します。指定された名称のオブジェクトが階層に属している種類ならば、この関数は true を返します。

関数

概要

b = Object:typeOf( name )

引数

string name
種類を確認をしたいオブジェクトの名称。

返値

boolean b
True ならばオブジェクトは指定された種類であり、それ以外は false です。

用例

オブジェクトの種類を確認します。

image = love.graphics.newImage("test.png")
print(image:typeOf("Object")) -- 出力: true
print(image:typeOf("Drawable")) -- 出力: true
print(image:typeOf("Image")) -- 出力: true
print(image:typeOf("MouseJoint")) -- 出力: false

関連

そのほかの言語