Game Maker Language リファレンス > 組み込み関数 用途別 > 2D グラフィック機能 > Spineの制御と描画 > skeleton_slot_data()
指定のSpineスプライトのスロット情報を ds_list に ds_map として情報を格納します
skeleton_slot_data(sprite, list);
この関数を使用すると、(事前に作成された)ds_listに、アニメーションに含まれる使用可能な各アタッチメントスロットのデータを取得できます。 このデータは、次のキーと値のペアを含むds_mapのリストで返されます。
各キーの値は文字列になり、これらのタイプのスプライトの他のスケルトン接続関数で使用できます。 作成されたds_mapは破棄されないので、ds_listをループして、作成された各マップを自分で破棄する必要があることに注意してください。
var list = ds_list_create(); var open = true; slot_name = ""; skeleton_slot_data(sprite_index, 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.