This function sets the shape of the fixture to that of a box (rectangle) with the specified dimensions.


GML Code Example

physics_fixture_set_box_shape(fixture, halfWidth, halfHeight)

Argument Description
fixture the index of the fixture
halfWidth the half width of the box
halfHeight the half height of the box

Returns: N/A


This function defines a box shape for your fixture. It takes the half width and height as the physics world uses this value far more than whole width/height values to determine things like collisions.


GML Code Example

physics_fixture_set_box_shape(fix_Border, room_width/2, 10);

The code above will apply a box shape to the fixture indexed in the variable "fix_Border" with a width of the room and a height of 20 pixels.

No Examples Submitted

Does this page need better examples? Be the first to Submit

No Edits Suggested

Is this page unclear or not descriptive enough? Suggest an edit to the page and with enough upvotes your changes will be made.

No Questions Have Been Ask

Do you have a question about this page? Ask it Here