sprite_set_bbox_mode

This function can be used to set the bounding box mode for a sprite. You supply the sprite index and the mode to use, which should be one of the following constants:

Bounding Box Mode Constant
ConstantDescription
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()

NOTE This function affects the sprite asset so that all further instances with this sprite will have the same bounding box mode.

 

Syntax:

sprite_set_bbox_mode(ind, mode);

ArgumentTypeDescription
indSprite AssetThe index of the sprite to change the mode of.
modeBounding Box Mode ConstantThe mode to set (a constant).

 

Returns

N/A

 

Example:

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

The above code checks the bbox mode for the current sprite and if it's not automatic, then it is set to that value.