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

(New translation (Based revision : 1 August 2015, at 15:19))
 
m (オブジェクトの種類を表示)
 
(3 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>
  
Line 24: Line 24:
 
[[Category:Functions]]
 
[[Category:Functions]]
 
== そのほかの言語 ==
 
== そのほかの言語 ==
{{i18n|Object:type}}
+
{{i18n (日本語)|Object:type}}

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

関連

そのほかの言語