skeleton_get_bounds(index);
参数 描述 index The bounding box index to get the values of.
Array (minimum 2 elements: numPoints, name [, xPos, yPos, etc...])
This function will return an array of values associated with any given bounding box for the currently assigned skeleton animation sprite. You supply the index number for the bounding box to get the details of (you can retrieve the total number of bounding boxes for the sprite using the function skeleton_get_num_bounds) and the functin will return an array with the following elements:
- [0] - the number of points on the bounding box (a real)
- [1] - the name of the bounding box (a string)
- [2] - the x position of the first point
- [3] - the y position of the first point
- [etc...] - further x/y position data up to the number of points on the bounding box
重要!该函数在试用版(Trial License)产品中不可用。
var num = skeleton_get_num_bounds();
var yy = 60;
for(var i = 0; i < num; i++;)
{
var b_info = skeleton_get_bounds(i);
if b_info[0] > 0
{
var data = b_info[1] + ":";
for(var j = 0; j < b_info[0]; j++;)
{
data += " (" + string(b_info[(j * 2) + 2]) + ", " + string(b_info[(j * 2) + 2 + 1]) + ")";
}
draw_text(20, yy, data);
yy += 20;
}
}
The above code will loop through each of the bounding boxes associated with the currently assigned sprite and then draw that data as a string to the screen.