gravity property
Vector2
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;
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);