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:

常量 描述
bboxmode_automatic Automatic - The bounding box will be calculated automatically, based on the tolerance setting for the sprite
bboxmode_fullimage Full 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_manual Manual - 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 resource so that all further instances with this sprite will have the same bounding box mode.


语法:

sprite_set_bbox_mode(ind, mode);

参数 描述
ind The index of the sprite to change the mode of.
mode The mode to set (a constant).


返回

N/A(无返回值)


例如:

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

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