skeleton_slot_data_instance()


Game Maker Language リファレンス > 組み込み関数 用途別 > 2D グラフィック機能 > Spineの制御と描画 > skeleton_slot_data_instance()

skeleton_slot_data_instance()

詳細

With this function you can populate a (pre-created) ds_list with data for each of the available attachment slots for the Spine sprite associated with the current instance (including any attachment modifications). This data is returned in the forum of a ds_map which contains the following key/value pairs:

  • name: スロット名
  • bone: ボーン名
  • attachment: 使用しているアタッチメント名 (使用していない場合は "(none)" )

The values for each key will be strings and can then be used in the other skeleton attachment functions for these types of sprite. Note that the ds_map created are not destroyed so you will need to loop through the ds_list and destroy each of the created maps yourself.

構文

skeleton_slot_data_instance(list);
list
ds_map を格納する ds_list

戻り値

N/A
なし

var list = ds_list_create();
var open = true;
slot_name = "";
skeleton_slot_data_instance(list);
for (var i = 0; i < ds_list_size(list); i++;)
{
  var map = list[| i];
  if open
  {
    if map[? "attachment"] == "(none)"
    {
      open = false;
      slot_name = map[? "name"];
    }
  }
  ds_map_destroy(map);
}
ds_list_destroy(list);

The above code creates a DS list and then populates it with the slot data for the instance sprite. This data is then parsed to extract the individual DS maps with the slot data. This is then checked to see if there is an empty slot, and if so the variable "slot_name" is assigned the empty slot name before the DS map is destroyed. Finally we destroy the DS list as it is no longer required.

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件



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