Box2DComponent class

Inheritance

Constructors

Box2DComponent({Size dimensions, int worldPoolSize = DEFAULT_WORLD_POOL_SIZE, int worldPoolContainerSize = DEFAULT_WORLD_POOL_CONTAINER_SIZE, double gravity = DEFAULT_GRAVITY, int velocityIterations = DEFAULT_VELOCITY_ITERATIONS, int positionIterations = DEFAULT_POSITION_ITERATIONS, double scale = DEFAULT_SCALE})

Properties

components OrderedSet<BodyComponent>
The list of components to be updated and rendered by the Box2DComponent.
read / write
dimensions Size
read / write
hashCode int
The hash code for this object. [...]
read-only, inherited
positionIterations int
read / write
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited
velocityIterations int
read / write
viewport Viewport
read / write
world World
read / write

Methods

add(BodyComponent component) → void
addAll(List<BodyComponent> component) → void
cameraFollow(BodyComponent component, {double horizontal, double vertical}) → void
destroy() bool
Whether this should be destroyed or not. [...]
inherited
initializeWorld() → void
isHud() bool
Whether this component is HUD object or not. [...]
inherited
loaded() bool
Whether this component has been loaded yet. If not loaded, BaseGame will not try to render it. [...]
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed. [...]
inherited
onDestroy() → void
Called right before the component is destroyed and removed from the game
inherited
onMount() → void
Called when the component has been added and preperad by the game instance. [...]
inherited
priority() int
Render priority of this component. This allows you to control the order in which your components are rendered. [...]
inherited
remove(BodyComponent component) → void
render(Canvas canvas) → void
Renders this component on the provided Canvas c.
override
resize(Size size) → void
This is a hook called by BaseGame to let this component know that the screen (or flame draw area) has been update. [...]
override
toString() String
A string representation of this object. [...]
inherited
update(double t) → void
This method is called periodically by the game engine to request that your component updates itself. [...]
override

Operators

operator ==(Object other) bool
The equality operator. [...]
inherited

Constants

DEFAULT_GRAVITY → const double
-10.0
DEFAULT_POSITION_ITERATIONS → const int
10
DEFAULT_SCALE → const double
1.0
DEFAULT_VELOCITY_ITERATIONS → const int
10
DEFAULT_WORLD_POOL_CONTAINER_SIZE → const int
10
DEFAULT_WORLD_POOL_SIZE → const int
100