Body

Body

Methods


body_set_size(object, width, height)


Sets the width and height of the physics body for an object.

Check out the third party documentation for a more in depth explanation.

Parameters:
Name Type Description
object

object to set the body of

width Number

width to set the body to

height Number

height to set the body to

Code Equivalent:
object.body.setSize(width, height);

body_set_size(object, width, height, offset_x, offset_y)


Sets the width and height of the physics body for an object, with an offset position. Offset is based on the anchor of the object.

Check out the third party documentation for a more in depth explanation.

Parameters:
Name Type Description
object

object to set the body of

width Number

width to set the body to

height Number

height to set the body to

offset_x Number

the amount to move the physics body by in the x direction, based on the object's position and anchor

offset_y Number

the amount to move the physics body by in the y direction, based on the object's position and anchor

Code Equivalent:
object.body.setSize(width, height);

debug_body(object)


Renders a visual for the physics body of the object. Will appear as a semi transparent filled green rectangle.

Check out the third party documentation for a more in depth explanation.

Parameters:
Name Type Description
object

object to render the body for

Code Equivalent:
game.debug.body(object);

get_body_boolean_field(element, object)


Returns the chosen boolean field value of the object.

Check out the third party documentation for a more in depth explanation.

Parameters:
Name Type Description
element

the value to get

object

object to get values from

Code Equivalent:
object.body.element

get_body_field_point_class(field, object)


Returns the chosen point field value of the object.

Check out the third party documentation for a more in depth explanation.

Parameters:
Name Type Description
field

the field to get the value of

object

object to get values from

Code Equivalent:
object.body.field

get_body_numeric_field(element, object)


Returns the chosen numeric field value of the object.

Check out the third party documentation for a more in depth explanation.

Parameters:
Name Type Description
element

the value to get

object

object to get values from

Code Equivalent:
object.body.element

set_body_boolean_field(field, object, boolean)


Assigns the chosen boolean field for the object.

Check out the third party documentation for a more in depth explanation.

Parameters:
Name Type Description
field

the field to set

object

object to assign values for

boolean

value to set the field to

Code Equivalent:
object.body.element = value;

set_body_field_point(field, value)

Parameters:
Name Type Description
field

the field to set

value

value to set the field to

Code Equivalent:
object.body.field.element = value;

set_body_field_point(field, element, value)


Assigns the chosen point field element for the object.

Check out the third party documentation for a more in depth explanation.

Parameters:
Name Type Description
field

the field to set

element

choose to assign the x or y element of the point

value

value to set the field to

Code Equivalent:
object.body.field.element = value;

set_body_field_point_class(field, object, point)

Parameters:
Name Type Description
field

the field to set

object

object to assign values for

point

point to set the field to

Code Equivalent:
object.body.field = point;

set_body_numeric_field(element, object, value)


Assigns the chosen numeric field for the object.

Check out the third party documentation for a more in depth explanation.

Parameters:
Name Type Description
element

the value to set

object

object to assign values for

value

value to set the field to

Code Equivalent:
object.body.element = value;

stop_body(object)


Sets the object's acceleration, velocity, and speed to 0.

Check out the third party documentation for a more in depth explanation.

Parameters:
Name Type Description
object

object to set values for

Code Equivalent:
object.body.stop();