asset_get_type()


Game Maker Language リファレンス > 組み込み関数 用途別 > リソース操作 > asset_get_type()

asset_get_type()

指定した文字列のリソースの種類を取得します

構文

asset_get_type(name);
name
リソース名(文字列)

戻り値

Constant
リソースの種類

リソースの種類は以下のいずれかを返します。

Contant詳細
asset_objectobject
asset_spritesprite
asset_soudsound
asset_roomroom
asset_pathpath
asset_scriptscript
asset_fontfont
asset_timelinetime line
asset_unknown存在しないリソース。もしくは上記以外のリソース

if asset_get_type("pth_Path_" + string(global.Game)) == asset_unknown
{
  show_debug_message("Path doesn't exist!!!");
}
else
{
  path_index = asset_get_index("pth_Path_" + string(global.Game));
}

上記コードは "pth_Path_" のリソース種別が有効な場合に "path_index" にパスリソースを代入しています。

Wiki内検索

#search(): You already view a search box

MENU

ドキュメント

GMLリファレンス

2ch

その他



最新の30件

2024-03-07 2023-08-09 2023-05-21 2023-05-20 2023-05-04 2022-10-13 2022-07-21 2022-07-02 2022-04-06 2021-11-30 2021-11-26 2021-10-03 2021-09-23 2021-08-15 2021-06-02 2021-01-23 2021-01-21 2021-01-19 2021-01-18 2021-01-16 2021-01-15

人気の10件

今日の10件



これまでの訪問者: 324
今日の訪問者: 1
昨日の訪問者: 0
閲覧者: 5