sprite_change_collision_mask

Updates collision mask properties of the sprite asset loaded from the /sprites folder.

ArgumentTypeDescription
sprite:stringThe name of the sprite to set the bounding box of
sepmasks:realWhether to create collision masks for each sub-image of the sprite (true) or one mask for all (false)
bboxmode:realThe kind of bounding box:
0 = automatic
1 = full image
2 = user defined
bbleft:realThe maximum left position of the bounding box
bbtop:realThe maximum top position of the bounding box
bbright:realThe maximum right position of the bounding box
bbbottom:realThe maximum bottom position of the bounding box
kind:realThe kind of mask:
0 = precise
1 = bounding box
2 = disk
3 = diamond

Example, called from init.gml:

// changing offset of the jump sprite to [94, 138]:
sprite_change_offset( "jump", 94, 138 );
// making it precise:
sprite_change_collision_mask( "jump", true, 0, 0, 0, 0, 0, 0 );