sprite_get_bbox_bottom

Returns the relative position of the bottom of the bounding box of the given sprite.

Syntax:

sprite_get_bbox_bottom(ind);


Argument Description
ind The index of the sprite to check.


Returns: Real


Description

This function returns the relative position of the bottom of the sprite bounding box. This value is given as a relative value based on the upper left corner of the base sprite asset being (0,0). it is the same value as can be found in the sprite editor for the collision mask properties. The image below shows how it is calculated:


Example:

var ww, hh;
ww = sprite_get_bbox_left(sprite_index) - sprite_get_bbox_right(sprite_index);
hh = sprite_get_bbox_bottom(sprite_index) - sprite_get_bbox_top(sprite_index);

The above code calculates the width and height of the collision mask based on the relative bounding box side positions.


Back: Sprites
Next: sprite_get_bbox_left
© Copyright YoYo Games Ltd. 2018 All Rights Reserved