sprite_set_bbox_mode

此函数可用于设置精灵的边界框模式。您可以提供sprite索引和要使用的模式,它应该是以下常量之一:

边界框模式常量
常量描述
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 is being set manually to user defined values, which requires the use of the function sprite_set_bbox()

注意此函数影响sprite资源,以便此精灵的所有其他实例将具有相同的边界框模式。

 

语法:

sprite_set_bbox_mode(ind, mode);

参数类型描述
indSprite Asset要更改模式的精灵的索引。
mode边界框模式常量设置(常数)的模式。

 

返回

N/A

 

例子:

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

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