gravity property
Vector2
get
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:
- Body.gravityScale, to multipy gravity for a Body.
- Body.gravityOverride, to change how the world treats the gravity for a Body.
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:
- Body.gravityScale, to multipy gravity for a Body.
- Body.gravityOverride, to change how the world treats the gravity for a Body.
Implementation
set gravity(Vector2 gravity) => this.gravity.setFrom(gravity);