sprite_get_bbox_right


语法:

sprite_get_bbox_right(ind);

参数 描述
ind 将会被检查的精灵的索引。


返回

Real(实数)


描述

This function returns the relative position of the right of the sprite bounding box. 此位置是相对与精灵资源的左上角(0,0)的。你可以在collision mask properties中找到相同的数值。下图描绘了这是如何工作的:


例如:

var ww, hh;
ww = sprite_get_bbox_left(sprite_index) - sprite_get_bbox_right(sprite_index);
hh = sprite_get_bbox_bottom(sprite_index) - sprite_get_bbox_top(sprite_index);

上述代码将会根据边界框四边的相对位置来计算碰撞遮罩的高度和宽度。.