gravity property

Vector2 get gravity

The current World's gravity.

All bodies are affected by gravity; unless the Body has a specified Body.gravityOverride. If so, Body.gravityOverride is used instead of gravity.

See also:

Implementation

Vector2 get gravity => _gravity;
set gravity (Vector2 gravity)

Changes the World's gravity.

All bodies are affected by gravity; unless the Body has a specified Body.gravityOverride. If so, Body.gravityOverride is used instead of gravity.

See also:

Implementation

set gravity(Vector2 gravity) => this.gravity.setFrom(gravity);