FlameText class

Inheritance
Mixed in types

Constructors

FlameText(String text, {TextStyle? textStyle, Color? color, TextAlign textAlign = TextAlign.center})

Properties

bounds ↔ Vector2
The bounds of this widget, you cannot draw outside of these This variable is initially set to 1, 1 only after being added to the UI this might change, so don't use it only in the constructor, but incorporate it in the render/update functions
getter/setter pairinherited
childBuild FlameWidget?
getter/setter pairinherited
context BuildContext?
getter/setter pairinherited
disposed bool
no setterinherited
hashCode int
The hash code for this object.
no setterinherited
hasLayout bool
getter/setter pair
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
textAlign TextAlign
getter/setter pair
textPainter TextPainter?
getter/setter pair

Methods

build(BuildContext context) FlameWidget
Return widgets here that should be drawn as child(ren) of this widget You should also update the child(ren) and call the render of the child(ren)
inherited
determinePrefferedSize(Vector2 parentBounds) → Vector2
Determine how large this widget wants to be, based on constraints like child, width, height, fontSize, ... use parentBounds for unpreffered sizes
override
dispose() → void
Overwrite to dispose when this object is removed from the tree
inherited
isInsideBounds(Vector2 point) bool
Check if a transformed point is inside your bounds (for child tap/drag)
inherited
markForRebuild() → void
Marks for rebuild, similar to setState in Flutter
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
onDragEnd(Vector2 position) → void
inherited
onDragStart(Vector2 position) → void
inherited
onDragUpdate(Vector2 position) → void
inherited
onScaleEnd(Vector2 position, double scale) → void
inherited
onScaleStart(Vector2 position) → void
inherited
onScaleUpdate(Vector2 position, double scale) → void
inherited
onTapDown(Vector2 tapPosition) → void
inherited
onTapUp(Vector2 tapPosition) → void
inherited
reBuildChild(BuildContext context, Vector2 bounds) → void
Used to build this child, override to disable if you don't require (re)build
inherited
render(Canvas canvas, BuildContext context) → void
How to draw this widget on the canvas
override
toString() String
A string representation of this object.
inherited
transformPoint(Vector2 point) → Vector2
transform a point for child tap/drag
inherited
update(double delta) → void
Implement this method to update the game state, given the time delta that has passed since the last update. Keep the updates as short as possible. delta is in seconds, with microseconds precision.
inherited
updateData(Vector2 newBounds, BuildContext context, FlameWidget? parent) → void
Update the bounds of this widget Must call super first when overriding this Note that your child(ren) should be updated during build
inherited

Operators

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