diff --git a/Manual/contents/GameMaker_Language/GML_Reference/Asset_Management/Sprites/Sprite_Information/sprite_get_bbox_bottom.htm b/Manual/contents/GameMaker_Language/GML_Reference/Asset_Management/Sprites/Sprite_Information/sprite_get_bbox_bottom.htm index f39beea3d..d16c5cc87 100644 --- a/Manual/contents/GameMaker_Language/GML_Reference/Asset_Management/Sprites/Sprite_Information/sprite_get_bbox_bottom.htm +++ b/Manual/contents/GameMaker_Language/GML_Reference/Asset_Management/Sprites/Sprite_Information/sprite_get_bbox_bottom.htm @@ -4,7 +4,7 @@
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:
+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:
sprite_get_bbox_bottom(ind);
+sprite_get_bbox_bottom(ind);
Argument | Type | +Argument | +Type | Description | -
---|---|---|---|---|
ind | + | ind | +Sprite Asset | The index of the sprite to check. | -
+
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.
-+
-
This function returns the relative position of the left 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:
+This function returns the relative position of the left of the sprite bounding box.
+The 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:
sprite_get_bbox_left(ind);
+sprite_get_bbox_left(ind);
Argument | Type | +Argument | +Type | Description | -
---|---|---|---|---|
ind | + | ind | +Sprite Asset | The index of the sprite to check. | -
+
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.
-+
-
This function will return the current "mode" for the bounding box calculations. You supply the sprite index of the sprite to check, and the function will return one of the constants shown below.
sprite_get_bbox_mode(ind);
+sprite_get_bbox_mode(ind);
Argument | Type | +Argument | +Type | Description | -
---|---|---|---|---|
ind | + | ind | +Sprite Asset | The index of the sprite to check. | -
Bounding Box Mode Constant
+bboxmode_manual | -Manual - The bounding box has been set manually to user defined values (either in the sprite editor, or using the function sprite_set_bbox()) | +Manual - The bounding box has been set manually to user-defined values (either in the Sprite Editor, or using the function sprite_set_bbox) |
if (sprite_get_bbox_mode(sprite_index) != 0)
+
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 sets it to that value.
-+
The above checks the bbox mode for the current sprite and, if it's not automatic, sets it to that value.
-
This function returns the relative position of the right 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:
+This function returns the relative position of the right 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:
sprite_get_bbox_right(ind);
+sprite_get_bbox_right(ind);
Argument | Type | +Argument | +Type | Description | -
---|---|---|---|---|
ind | + | ind | +Sprite Asset | The index of the sprite to check. | -
+
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);
var _ww, _hh;
+ _ww = sprite_get_bbox_right(sprite_index) - sprite_get_bbox_left(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.
-
-
This function returns the relative position of the top 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:
+This function returns the relative position of the top 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:
sprite_get_bbox_top(ind);
+sprite_get_bbox_top(ind);
Argument | Type | +Argument | +Type | Description | -
---|---|---|---|---|
ind | + | ind | +Sprite Asset | The index of the sprite to check. | -
+
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.
-+