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

m
m (オブジェクトの種類を表示)
 
(2 intermediate revisions by the same user not shown)
Line 8: Line 8:
 
なし。
 
なし。
 
=== 返値 ===
 
=== 返値 ===
{{param|string|type|種類を文字列形式で返します。}}
+
{{param|string|type|オブジェクトの種類を文字列形式で返します。}}
 
== 用例 ==
 
== 用例 ==
=== オブジェクトの種類を表示します。 ===
+
=== オブジェクトの種類を表示 ===
 
<source lang="lua">
 
<source lang="lua">
 
image = love.graphics.newImage("test.png")
 
image = love.graphics.newImage("test.png")
print(image:type()) -- 出力: Image
+
print(image:type()) -- 結果: Texture
 
source = love.audio.newSource("test.ogg")
 
source = love.audio.newSource("test.ogg")
print(source:type()) -- 出力: Source
+
print(source:type()) -- 結果: Source
 
</source>
 
</source>
  

Latest revision as of 03:40, 16 June 2023

オブジェクトの種類を文字列形式で取得します。

関数

概要

type = Object:type()

引数

なし。

返値

string type
オブジェクトの種類を文字列形式で返します。

用例

オブジェクトの種類を表示

image = love.graphics.newImage("test.png")
print(image:type()) -- 結果: Texture
source = love.audio.newSource("test.ogg")
print(source:type()) -- 結果: Source

関連

そのほかの言語