PositionComponent class

A Component implementation that represents a component that has a specific, possibly dynamic position on the screen.

It represents a rectangle of dimension (width, height), on the position (x, y), rotate around its center with angle angle. It also uses the anchor property to properly position itself.

Inheritance
Implementers

Constructors

PositionComponent()

Properties

anchor Anchor
read / write
angle double
read / write
debugColor Color
read-only
debugMode bool
read / write
debugTextConfig TextConfig
read-only
hashCode int
The hash code for this object. [...]
read-only, inherited
height double
read / write
renderFlipX bool
read / write
renderFlipY bool
read / write
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited
width double
read / write
x double
read / write
y double
read / write

Methods

addEffect(PositionComponentEffect effect) → void
angleBetween(PositionComponent c) double
clearEffects() → void
destroy() bool
Whether this should be destroyed or not. [...]
inherited
distance(PositionComponent c) double
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
prepareCanvas(Canvas canvas) → void
priority() int
Render priority of this component. This allows you to control the order in which your components are rendered. [...]
inherited
removeEffect(PositionComponentEffect effect) → void
render(Canvas c) → void
Renders this component on the provided Canvas c.
inherited
renderDebugMode(Canvas canvas) → void
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. [...]
inherited
setByPosition(Position position) → void
setByRect(Rect rect) → void
setBySize(Position size) → void
toPosition() Position
toRect() Rect
toSize() Position
toString() String
Returns a string representation of this object.
inherited
update(double dt) → void
This method is called periodically by the game engine to request that your component updates itself. [...]
@mustCallSuper, override

Operators

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