sprite_get_bbox_mode

此函数将返回边界框计算的当前“模式”。您提供要检查的精灵的精灵索引,该函数将返回如下所示的常量之一。

 

语法:

sprite_get_bbox_mode(ind);

参数类型描述
indSprite Asset要检查的精灵的索引。

 

返回

Bounding Box Mode Constant

常量描述
bboxmode_automaticAutomatic - The bounding box will be calculated automatically, based on the tolerance setting for the sprite
bboxmode_fullimageFull Image - The bounding box will be set to use the full width and height of the sprite, regardless of the tolerance and "empty" pixels
bboxmode_manualManual - The bounding box has been set manually to user defined values (either in the sprite editor, or using the function sprite_set_bbox())

 

例子:

if (sprite_get_bbox_mode(sprite_index) != 0)
{
    sprite_set_bbox_mode(sprite_index, bboxmode_automatic);
}

上面检查了当前精灵的bbox模式,如果它不是自动,则将其设置为该值。