bonfire library

Classes

Aabb2
Defines a 2-dimensional axis-aligned bounding box between a min and a max position.
Aabb3
Defines a 3-dimensional axis-aligned bounding box between a min and a max position.
AcceleratedParticle
A particle that serves as a container for basic acceleration physics.
AccelerationForce2D
Apply acceleration to velocity {value} pixel/seconds
AdvancedButtonComponent
The AdvancedButtonComponent has different skins for different button states. The defaultSkin must be added to the constructor or if you are inheriting - defined in the onLod method.
Ally
Created by
Anchor
Represents a relative position inside some 2D object with a rectangular size or bounding box.
AnchorByEffect
An AnchorEffect that changes its target's anchor by the specified offset.
AnchorEffect
Base class for effects that affect the anchor of their targets.
AnchorProvider
Interface for a component that can be affected by anchor effects.
AnchorToEffect
An effect that moves the target's anchor to the specified value.
AngleProvider
Interface for a component that can be affected by rotation effects.
AnimatedFollowerGameObject
Animated component that follow othe GameComponent
AnimatedGameObject
Animated component
ArcLightingType
AssetsCache
A class that loads, and caches files.
AssetsLoader<T>
AssetToLoad<T>
AwaitCallbackSceneAction
Created by
BackgroundStyle
BarLifeComponent
BatchItem
A single item in a SpriteBatch.
Block
This is just a pair of <int, int>.
BlockElement
BlockElement is the base class for TextElements with rectangular shape and "block" placement rules.
BlockNode
BlockNode is a base class for all nodes with "block" placement rules; it roughly corresponds to <div/> in HTML.
BlockStyle
BlockStyle is a generic descriptor for a visual appearance of a block- level element.
BoldTextNode
BonfireGame
Is a customGame where all magic of the Bonfire happen.
BonfireGameInterface
Created by
BonfireUtil
BonfireWidget
BonfireWidgetState
Broadphase<T extends Hitbox<T>>
The Broadphase class is used to make collision detection more efficient by doing a rough estimation of which hitboxes that can collide before their actual intersections are calculated.
CameraComponent
CameraComponent is a component through which a World is observed.
CameraConfig
Class use to configure camera behavior.
CameraParallaxComponent
CameraSceneAction
Created by
Canvas
An interface for recording graphical operations.
CircleCircleIntersections
CircleComponent
CircleHitbox
A Hitbox in the shape of a circle.
CircleLightingType
CircleParticle
Plain circle with no other behaviors.
CirclePolygonIntersections
ClipComponent
A component that will clip its content.
CollisionData
CollisionDetection<T extends Hitbox<T>, B extends Broadphase<T>>
CollisionDetection is the foundation of the collision detection system in Flame.
CollisionDetectionCompletionNotifier
A class to handle callbacks for when the collision detection is done each tick.
CollisionProspect<T>
A CollisionProspect is a tuple that is used to contain two potentially colliding hitboxes.
CollisionTypeNotifier
Utility class allows to subscribe on collision type changing event
Color
An immutable 32 bit color value in ARGB format.
ColorEffect
Change the color of a component over time.
ColumnNode
ColumnNode is a block node containing other block nodes arranged as a column.
Component
Components are the basic building blocks for a FlameGame.
ComponentEffect<T extends Component>
Base class for effects that target a Component of type T.
ComponentKey
A key that can be used to identify a component and later retrieve it from its FlameGame ancestor.
ComponentParticle
ComponentSet
This is a simple wrapper over QueryableOrderedSet to be used by Component.
ComponentsNotifier<T extends Component>
A ChangeNotifier that notifies its listeners when a Component is added or removed, or updated. The meaning of an updated component will vary depending on the component implementation, this is something defined and executed by the component itself.
ComponentsNotifierBuilder<T extends Component>
A widget that rebuilds every time the given notifier changes.
ComponentSpawner
Componente used to spaw other components
ComposedParticle
A single Particle which manages multiple children by proxying all lifecycle hooks.
CompositeHitbox
In this PositionComponent hitboxes can be added to emulate a hitbox that is a composition of other hitboxes.
ComputedParticle
An abstract Particle container which delegates rendering outside Allows to implement very interesting scenarios from scratch.
CoordinateTransform
Interface to be implemented by components that perform a coordinate change.
CurvedEffectController
A controller that grows non-linearly from 0 to 1 following the provided curve. The duration cannot be 0.
CurvedParticle
A Particle which applies certain Curve for easing or other purposes to its progress getter.
CustomPainterComponent
A PositionComponent that renders a CustomPainter at the designated position, scaled to have the designated size and rotated to the specified angle.
DelayedEffectController
An effect controller that waits for delay seconds before running the child controller. While waiting, the progress will be reported at 0.
DelaySceneAction
Created by
DocumentRoot
DocumentStyle
DocumentStyle is a user-facing description of how to render an entire body of text; it roughly corresponds to a stylesheet in HTML.
DurationEffectController
Abstract class for an effect controller that has a predefined duration.
Effect
An Effect is a component that changes properties or appearance of another component over time.
EffectController
Base "controller" class to facilitate animation of effects.
Enemy
It is used to represent your enemies.
Flame
This class holds static references to some useful objects to use in your game.
FlameTextStyle
A FlameTextStyle is a base class for several classes that collectively describe the desired visual appearance of a "rich-text" document.
FlyingAttackGameObject
Animated component used like range attack.
FollowerWidget
With this widget you can add a widget what follows a component in the game.
FollowerWidgetState
Force2D
FpsComponent
The FpsComponent is a non-visual component which you can get the current fps of the game with by calling fps, once the component has been added to the component tree.
FpsTextComponent<T extends TextRenderer>
The FpsTextComponent is a TextComponent that writes out the current FPS. It has a FpsComponent as a child which does the actual calculations.
Frustum
Defines a frustum constructed out of six Planes.
GameBackground
Base to create your custom game background
GameColorFilter
GameComponent
Base of the all components in the Bonfire
GameDecoration
This component represents anything you want to add to the scene, it can be a simple "barrel" halfway to an NPC that you can use to interact with your player.
GameDecorationWithCollision
GameDecoration with collision used in construct of the map with Tiled
GameInterface
The way you cand raw things like life bars, stamina and settings. In another words, anything that you may add to the interface to the game.
GameMap
GameObject
GestureEvent
GlowEffect
Change the MaskFilter on Paint of a component over time.
Glyph
Glyph describes a single character/ligature/icon within a SpriteFont.
GravityForce2D
Apply acceleration to velocity {value} pixel/seconds
GroupTextNode
HeaderNode
Hitbox<T extends Hitbox<T>>
The Hitbox is the default building block to determine whether two objects have collided with each other. ShapeHitbox is the default implementation used in FCS.
Image
Opaque handle to raw decoded image data (pixels).
ImageComposition
The ImageComposition allows for composing multiple images onto a single image.
ImageParticle
A Particle which renders given Image on a Canvas image is centered. If any other behavior is needed, consider using ComputedParticle.
Images
InfiniteEffectController
Effect controller that wraps a child effect controller and repeats it infinitely.
InlineTextElement
InlineTextElement is the base class that represents a single line of text, laid out and prepared for rendering.
InlineTextNode
InlineTextNode is a base class for all nodes with "inline" placement rules; it roughly corresponds to <span/> in HTML.
InlineTextStyle
InterfaceComponent
Component used to add in your GameInterface
InternalNineTileBox
InternalSpriteAnimationWidget
A StatefulWidget that render a SpriteAnimation.
InternalSpriteButton
InternalSpriteWidget
A StatefulWidget that renders a still Sprite.
IntersectionResult
Defines a result of an intersection test.
Intersections<T1 extends ShapeComponent, T2 extends ShapeComponent>
IntervalTick
IsometricTileMapComponent
This component renders a tilemap, represented by an int matrix, given a tileset, in which the integers are the block ids.
ItalicTextNode
ItemMatrixProperties
Created by
Joystick
JoystickAction
JoystickActionEvent
JoystickDirectional
JoystickDirectionalEvent
KeyboardConfig
KeyboardDirectionalKeys
KeyboardListenerComponent
A Component that receives keyboard input and executes registered methods. This component is based on KeyboardHandler, which requires the FlameGame which is used to be mixed with HasKeyboardHandlerComponents.
LayerPriority
LightingConfig
Class used to configure lighting
LightingType
Created by
Line
An infinite line on the 2D Cartesian space, represented in the form of ax + by = c.
LinearEffectController
A controller that grows linearly from 0 to 1 over duration seconds.
LinearForce2D
Apply linear force to velocity
LineMetrics
The LineMetrics object contains measurements of a text line.
LineSegment
A LineSegment represent a segment of an infinitely long line, it is the segment between the from and to vectors (inclusive).
MapTerrain
MapTerrainCorners
Matrix2
2D Matrix. Values are stored in column major order.
Matrix3
3D Matrix. Values are stored in column major order.
Matrix4
4D Matrix. Values are stored in column major order.
MatrixMapGenerator
Class useful to create radom map.
MemoryCache<K, V>
Simple class to cache values with size based eviction.
MiniMap
MoveAlongPathEffect
This effect will move the target along the specified path, which may contain curved segments, but must be simply-connected.
MoveByEffect
A MoveEffect that moves its target by the specified offset vector.
MoveComponentSceneAction<T extends Movement>
Created by
MoveEffect
Base class for effects that affect the position of their targets.
MovementByJoystickProps
MoveToEffect
A MoveEffect that moves its target towards the given destination point.
MovingParticle
Statically move given child Particle by given Vector2.
NineTileBox
This allows you to create a rectangle textured with a 9-sliced image.
NineTileBoxComponent
This class is a thin wrapper on top of NineTileBox as a component.
NineTileBoxWidget
A StatelessWidget that renders NineTileBox
Npc
Created by
Obb3
Defines a 3-dimensional oriented bounding box defined with a center, halfExtents and axes.
Offset
An immutable 2D floating-point offset.
OpacityEffect
Change the opacity of a component over time.
OpacityProvider
Interface for a component that can be affected by opacity effects. Value of opacity must be in the range of 0-1 (both inclusive).
PaintParticle
A particle which renders its child with certain Paint Could be used for applying composite effects. Be aware that any composite operation is relatively expensive, as involves copying portions of GPU memory. The less pixels copied, the faster it'll be.
ParagraphNode
Parallax
A full parallax, several layers of images drawn out on the screen and each layer moves with different velocities to give an effect of depth.
ParallaxAnimation
Specifications with a SpriteAnimation and how it should be drawn in relation to the device screen
ParallaxAnimationData
Contains the fields and logic to load a ParallaxAnimation.
ParallaxComponent<T extends FlameGame<World>>
A full parallax, several layers of images drawn out on the screen and each layer moves with different velocities to give an effect of depth.
ParallaxData
ParallaxImage
Specifications with a path to an image and how it should be drawn in relation to the device screen
ParallaxImageData
Contains the fields and logic to load a ParallaxImage.
ParallaxLayer
Represents one layer in the parallax, draws out an image on a canvas in the manner specified by the parallaxImage.
ParallaxRenderer
Particle
Base class implementing common behavior for all the particles.
ParticleSystemComponent
A PositionComponent that renders a Particle at the designated position, scaled to have the designated size and rotated to the specified angle.
PauseEffectController
A controller that keeps constant progress over duration seconds.
PlainTextNode
Plane
PlatformAnimations
PlatformEnemy
PlatformJumpAnimations
PlatformPlayer
Player
PlayerController
PolygonComponent
PolygonHitbox
A Hitbox in the shape of a polygon.
PolygonPolygonIntersections
PositionComponent
A Component implementation that represents an object that can be freely moved around the screen, rotated, and scaled.
PositionProvider
Interface for a component that can be affected by move effects.
ProspectPool<T extends Hitbox<T>>
This pool is used to not create unnecessary CollisionProspect objects during collision detection, but to re-use the ones that have already been created.
Quad
Defines a quad by four points.
QuadTree<T extends Hitbox<T>>
QuadTree calculation class not bound to Flame. Could be used anywhere outside of Flame, for example in isolates to calculate background logic.
QuadTreeBroadphase
Performs Quad Tree broadphase check.
QuadTreeCollisionDetection
Collision detection modification to support a Quad Tree broadphase.
QuadTreeNode<T extends Hitbox<T>>
QuadTreeNodeDebugInfo
Public interface to QuadTree internal data structures.
Quaternion
Defines a Quaternion (a four-dimensional vector) for efficient rotation calculations.
RandomEffectController
An EffectController that wraps another effect controller child and randomizes its duration after each reset.
RandomVariable
RandomVariable is an object capable of producing random values with the prescribed distribution function. Each distribution is implemented within its own derived class.
Ray
Defines a Ray by an origin and a direction.
Ray2
A ray in the 2d plane.
RaycastResult<T extends Hitbox<T>>
The result of a raycasting operation.
ReadOnlyAngleProvider
Interface for a class that has angle property which can be read but not modified.
ReadOnlyPositionProvider
Interface for a class that has position property which can be read but not modified.
ReadOnlyScaleProvider
Interface for a class that has scale property which can be read but not modified.
ReadOnlySizeProvider
Interface for a class that has size property which can be read but not modified.
Rect
An immutable, 2D, axis-aligned, floating-point rectangle whose coordinates are relative to a given origin.
RectangleComponent
RectangleHitbox
A Hitbox in the shape of a rectangle (a simplified polygon).
RectElement
RemoveEffect
This simple effect, when attached to a component, will cause that component to be removed from the game tree after delay seconds.
RepeatedEffectController
Effect controller that repeats child controller a certain number of times.
ResistanceForce2D
Apply resistence to velocity {value} pixel/seconds
ReverseCurvedEffectController
A controller that grows non-linearly from 1 to 0 following the provided curve. The duration cannot be 0.
ReverseLinearEffectController
A controller that grows linearly from 1 to 0 over duration seconds.
RotateEffect
Rotate a component around its anchor.
RotatingParticle
A particle which rotates its child over the lifespan between two given bounds in radians
RotationAlly
Created by
RotationEnemy
Enemy used for top-down perspective
RotationNpc
Created by
RotationPlayer
RRectElement
Say
ScaledParticle
Statically scales the given child Particle by given scale.
ScaleEffect
Scale a component.
ScaleProvider
Interface for a component that can be affected by scale effects.
ScalingParticle
A particle which scale its child over the lifespan between 1 and a provided scale.
SceneAction
Created by
SceneBuilderComponent
Component responsible for run the SceneActions
SceneBuilderStatus
Created by
ScreenHitbox<T extends FlameGame<World>>
This component is used to detect hitboxes colliding into the edges of the viewport of the game.
ScrollTextBoxComponent<T extends TextRenderer>
ScrollTextBoxComponent configures the layout and interactivity of a scrollable text box. It focuses on the box's size, scrolling mechanics, padding, and alignment, contrasting with TextRenderer, which handles text appearance like font and color.
SequenceEffect
Run multiple effects in a sequence, one after another.
SequenceEffectController
An effect controller that executes a list of other controllers one after another.
ShapeComponent
A shape can represent any geometrical shape with optionally a size, position and angle. It can also have an anchor if it shouldn't be rotated around its center. A point can be determined to be within of outside of a shape.
SimpleAlly
Created by
SimpleDirectionAnimation
Class responsible to manager animation on SimplePlayer and SimpleEnemy
SimpleEnemy
Enemy with animation in all direction
SimpleNpc
Created by
SimplePlayer
SimplexNoise
SineEffectController
This effect controller follows a sine wave.
Size
Holds a 2D floating-point size.
SizeEffect
Change the size of a component over time.
SizeProvider
Interface for a component that can be affected by size effects.
SpawnComponent
The SpawnComponent is a non-visual component which can spawn PositionComponents randomly within a set area. If area is not set it will use the size of the nearest ancestor that provides a size. period will set the static time interval for when it will spawn new components. If you want to use a non static time interval, use the SpawnComponent.periodRange constructor. If you want to set the position of the spawned components yourself inside of the factory, set selfPositioning to true.
SpeedEffectController
This controller can force execution of an effect at a predefined speed.
Sphere
Defines a sphere with a center and a radius.
Sprite
A Sprite is a region of an Image that can be rendered in the Canvas.
SpriteAnimation
Represents a sprite animation, that is, a list of sprites that change with time.
SpriteAnimationComponent
SpriteAnimationData
SpriteAnimationFrame
Represents a single sprite animation frame.
SpriteAnimationFrameData
SpriteAnimationGroupComponent<T>
SpriteAnimationParticle
A Particle which applies certain SpriteAnimation.
SpriteAnimationTicker
A helper class to make the spriteAnimation tick.
SpriteAnimationWidget
A StatelessWidget that renders a SpriteAnimation
SpriteBatch
The SpriteBatch API allows for rendering multiple items at once.
SpriteBatchComponent
SpriteButton
A StatelessWidget that uses SpriteWidgets to render a pressable button
SpriteComponent
A PositionComponent that renders a single Sprite at the designated position, scaled to have the designated size and rotated to the specified angle.
SpriteFont
SpriteFont contains information about a custom font stored in an asset file.
SpriteFontRenderer
SpriteFontRenderer will render text using a SpriteFont font, creating a SpriteFontTextElement.
SpriteFontTextElement
SpriteGroupComponent<T>
A PositionComponent that can have multiple Sprites and render the one mapped with the current key.
SpriteParticle
A Particle which applies certain Sprite.
SpriteSheet
Utility class to help extract animations and sprites from a sprite sheet image.
SpriteWidget
A StatelessWidget which renders a Sprite To render an animation, use SpriteAnimationWidget.
StandardCollisionDetection<B extends Broadphase<ShapeHitbox>>
The default implementation of CollisionDetection. Checks whether any ShapeHitboxs in items collide with each other and calls their callback methods accordingly.
Sweep<T extends Hitbox<T>>
TalkDialog
TalkDialogState
TerrainBuilder
Created by
TerrainSpriteSheet
TextBlockNode
TextBoxComponent<T extends TextRenderer>
TextBoxConfig
A set of configurations for the TextBoxComponent itself, as opposed to the TextRenderer, which contains the configuration for how to render the text only (font size, color, family, etc).
TextComponent<T extends TextRenderer>
TextDamageComponent
TextElement
An TextElement is a basic rendering block of a rich-text document.
TextElementComponent
TextInterfaceComponent
Component used to add Text in your GameInterface
TextNode<T extends FlameTextStyle>
TextPaint
TextPaint applies a Flutter TextStyle to a string of text, creating a TextPainterTextElement.
TextPainterTextElement
TextRenderer
TextRenderer is an abstract interface for a class that can convert an arbitrary string of text into a renderable InlineTextElement.
TextRendererFactory
TextStyle
An immutable style describing how to format and paint text.
Tile
TiledCacheProvider
TiledObjectProperties
TiledReader
TileModel
TileModelAnimation
TileModelSprite
TileWithCollision
Timer
Simple utility class that helps handling time counting and implementing interval like events.
TimerComponent
A component that uses a Timer instance which you can react to when it has finished.
ToggleButtonComponent
The ToggleButtonComponent is an AdvancedButtonComponent that can switch between the selected and not selected state, imagine for example a switch widget or a tab that can be selected.
Transform2DEffect
Base class for effects that target a Transform2D property.
TranslatedParticle
Statically offset given child Particle by given Vector2.
Triangle
Defines a triangle by three points.
TypeWriter
TypeWriterState
ValueCache<T>
Used for caching calculated values, the cache is determined to be valid by comparing a list of values that can be of any type and is compared to the values that was last used when the cache was updated.
ValueGeneratorComponent
Component used to generate numbers using the gameLoop.
Vector
Base class for vectors
Vector2
2D column vector.
Vector3
3D column vector.
Vector4
4D column vector.
World
The root component for all game world elements.
WorldMap
WorldMapByTiled
ZigzagEffectController
This effect controller goes from 0 to 1, then back to 0, then to -1, and then again to 0.

Mixins

Attackable
Mixin responsible for adding damage-taking behavior to the component.
AutomaticRandomMovement
Mixin responsible for adding random movement like enemy walking through the scene
BlockMovementCollision
Mixin responsible for adding stop the movement when happen collision
BonfireHasGameRef
BouncingObject
CanNotSeen
CollisionCallbacks
CollisionPassthrough
This mixin can be used if you want to pass the CollisionCallbacks to the next ancestor that can receive them. It can be used to group hitboxes together on a component, that then is added to another component that also cares about the collision events of the hitboxes.
ComponentViewportMargin<T extends FlameGame<World>>
The ComponentViewportMargin positions itself by a margin to the edge of the Viewport (or another parent with a size) instead of by an absolute position on the screen or on the game, so if the game is resized the component will move to keep its margin.
DragGesture
EffectTarget<T>
Mixin adds field target of type T to an Effect. The target can be either set explicitly by the effect class, or acquired automatically from the effect's parent when mounting.
FlipRender
Follower
Created by
GenericCollisionCallbacks<T>
The GenericCollisionCallbacks mixin can be used to get callbacks from the collision detection system, potentially without using the Flame component system. The default implementation used with FCS is CollisionCallbacks. The generic type T here is the type of the object that has the hitboxes are attached to, for example it is PositionComponent in the StandardCollisionDetection.
GestureHitboxes
This mixin can be used if you want to use hitboxes to determine whether a gesture is within the Component or not.
HandleForces
Mixin that makes the component suffer influences from global or local forces. To adds local forces just call addForce method. To adds global foreces use the param globalForces in BonfireWidget.
HasAncestor<T extends Component>
A mixin that ensures an ancestor is of the given type T.
HasCollisionDetection<B extends Broadphase<ShapeHitbox>>
Keeps track of all the ShapeHitboxs in the component's tree and initiates collision detection every tick.
HasDecorator
HasDecorator mixin adds a nullable decorator field to a Component. If this field is set, it will apply the visual effect encapsulated in this Decorator to the component. If the field is not set, then the component will be rendered normally.
HasGameReference<T extends FlameGame<World>>
HasGameReference mixin provides property game, which is the cached accessor for the top-level game instance.
HasGenericCollisionDetection<T extends Hitbox<T>, B extends Broadphase<T>>
This mixin is useful if you have written your own collision detection which isn't operating on ShapeHitbox since you can have any hitbox here.
HasPaint<T extends Object>
Adds a collection of paints and paint layers to a component
HasQuadTreeCollisionDetection<W extends World>
This should be applied to a FlameGame to bring QuadTree collision support.
HasTimeScale
This mixin allows components to control their speed as compared to the normal speed. Only framerate independent logic will benefit timeScale changes.
HasVisibility
A mixin that allows a component visibility to be toggled without removing it from the tree. Visibility affects the component and all it's children/descendants.
HasWorldReference<T extends World>
HasWorldReference mixin provides the world property, which is the cached accessor for the world instance that this component belongs to.
IgnoreEvents
This mixin allows a component and all it's descendants to ignore events.
InternalChecker
Created by
Jumper
Mixin used to adds the jumper behavior. It's useful to platform games. OBS: It's needed adds a force to simulate gravity like. Example: BonfireWidget( globalForces: GravityForce2D(), , )
JumperAnimation
Mixin used to adds animations in a Jumper.
KeyboardEventListener
KeyboardHandler
A Component mixin to add keyboard handling capability to components. Must be used in components that can only be added to games that are mixed with HasKeyboardHandlerComponents.
Lighting
Mixin used to configure lighting in your component
MouseEventListener
Mixin responsible to listen mouse gestures
MoveCameraUsingGesture
Mixin used to move camera with gestures (touch or mouse)
Movement
Mixin responsible for adding movements
MovementByJoystick
Mixin responsible for adding movements through joystick events
MovePerCell
Notifier
Makes a component capable of notifying listeners of changes.
ParentIsA<T extends Component>
A mixin that ensures a parent is of the given type T.
PathFinding
Mixin responsible for find path using a_star_algorithm and moving the component through the path
PlayerControllerListener
PolygonRayIntersection<T extends ShapeHitbox>
Used to add the rayIntersection method to RectangleHitbox and PolygonHitbox, used by the raytracing and raycasting methods.
Pushable
Created by
Sensor<T extends GameComponent>
Mixin responsible for adding trigger to detect other objects above T is a type that Sensor will be find contact.
ShapeHitbox
A ShapeHitbox turns a ShapeComponent into a Hitbox. It is currently used by CircleHitbox, RectangleHitbox and PolygonHitbox.
SingleChildParticle
Implements basic behavior for nesting Particle instances into each other.
Snapshot
A mixin that enables caching a component and all its children. If renderSnapshot is set to true, the component and its children will be rendered to a cache. Subsequent renders use the cache, dramatically improving performance. This is only effective if the component and its children do not change - i.e. they are not animated and they do not move around relative to each other.
TapGesture
TileRecognizer
Created by
UseAssetsLoader
Created by
UseLifeBar
UseSprite
Created by
UseSpriteAnimation
Created by
Vision
Mixin used to adds basic Vision to the component

Constants

degrees2Radians → const double
Constant factor to convert and angle from degrees to radians.
radians2Degrees → const double
Constant factor to convert and angle from radians to degrees.
tau → const double
A simpler constant to use for angles than 2pi (well it is 2pi).

Properties

sensorColor Color
final

Functions

absoluteError(dynamic calculated, dynamic correct) double
Returns absolute error between calculated and correct. The type of calculated and correct must match and can be any vector, matrix, or quaternion.
buildPlaneVectors(Vector3 planeNormal, Vector3 u, Vector3 v) → void
Sets u and v to be two vectors orthogonal to each other and planeNormal.
catmullRom(double edge0, double edge1, double edge2, double edge3, double amount) double
Do a catmull rom spline interpolation with edge0, edge1, edge2 and edge3 by amount.
cross2(Vector2 x, Vector2 y) double
2D cross product. vec2 x vec2.
cross2A(double x, Vector2 y, Vector2 out) → void
2D cross product. double x vec2.
cross2B(Vector2 x, double y, Vector2 out) → void
2D cross product. vec2 x double.
cross3(Vector3 x, Vector3 y, Vector3 out) → void
3D Cross product.
degrees(double radians) double
Convert radians to degrees.
dot2(Vector2 x, Vector2 y) double
2D dot product.
dot3(Vector3 x, Vector3 y) double
3D dot product.
firstWhere<E>(Iterable<E> list, bool test(E element)) → E?
getZoomFromMaxVisibleTile(BuildContext context, double tileSize, int maxTile, {Orientation? orientation}) double
intersections(ShapeComponent shapeA, ShapeComponent shapeB) Set<Vector2>
makeFrustumMatrix(double left, double right, double bottom, double top, double near, double far) Matrix4
Constructs a new OpenGL perspective projection matrix.
makeInfiniteMatrix(double fovYRadians, double aspectRatio, double zNear) Matrix4
Constructs a new OpenGL infinite projection matrix.
makeOrthographicMatrix(double left, double right, double bottom, double top, double near, double far) Matrix4
Constructs a new OpenGL orthographic projection matrix.
makePerspectiveMatrix(double fovYRadians, double aspectRatio, double zNear, double zFar) Matrix4
Constructs a new OpenGL perspective projection matrix.
makePlaneProjection(Vector3 planeNormal, Vector3 planePoint) Matrix4
Returns a transformation matrix that transforms points onto the plane specified with planeNormal and planePoint.
makePlaneReflection(Vector3 planeNormal, Vector3 planePoint) Matrix4
Returns a transformation matrix that transforms points by reflecting them through the plane specified with planeNormal and planePoint.
makeViewMatrix(Vector3 cameraPosition, Vector3 cameraFocusPosition, Vector3 upDirection) Matrix4
Constructs a new OpenGL view matrix.
mix(double min, double max, double a) double
Interpolate between min and max with the amount of a using a linear interpolation. The computation is equivalent to the GLSL function mix.
pickRay(Matrix4 cameraMatrix, num viewportX, num viewportWidth, num viewportY, num viewportHeight, num pickX, num pickY, Vector3 rayNear, Vector3 rayFar) bool
On success, rayNear and rayFar are the points where the screen space pickX, pickY intersect with the near and far planes respectively.
radians(double degrees) double
Convert degrees to radians.
relativeError(dynamic calculated, dynamic correct) double
Returns relative error between calculated and correct. The type of calculated and correct must match and can be any vector, matrix, or quaternion.
renderSpriteByRadAngle(Canvas canvas, double radAngle, Rect rect, Sprite sprite, {Paint? overridePaint}) → void
setFrustumMatrix(Matrix4 perspectiveMatrix, double left, double right, double bottom, double top, double near, double far) → void
Constructs an OpenGL perspective projection matrix in perspectiveMatrix.
setInfiniteMatrix(Matrix4 infiniteMatrix, double fovYRadians, double aspectRatio, double zNear) → void
Constructs an OpenGL infinite projection matrix in infiniteMatrix. fovYRadians specifies the field of view angle, in radians, in the y direction. aspectRatio specifies the aspect ratio that determines the field of view in the x direction. The aspect ratio of x (width) to y (height). zNear specifies the distance from the viewer to the near plane (always positive).
setModelMatrix(Matrix4 modelMatrix, Vector3 forwardDirection, Vector3 upDirection, double tx, double ty, double tz) → void
Constructs an OpenGL model matrix in modelMatrix. Model transformation is the inverse of the view transformation. Model transformation is also known as "camera" transformation. Model matrix is commonly used to compute a object location/orientation into the full model-view stack.
setOrthographicMatrix(Matrix4 orthographicMatrix, double left, double right, double bottom, double top, double near, double far) → void
Constructs an OpenGL orthographic projection matrix in orthographicMatrix.
setPerspectiveMatrix(Matrix4 perspectiveMatrix, double fovYRadians, double aspectRatio, double zNear, double zFar) → void
Constructs an OpenGL perspective projection matrix in perspectiveMatrix.
setRotationMatrix(Matrix4 rotationMatrix, Vector3 forwardDirection, Vector3 upDirection) → void
Constructs a rotation matrix in rotationMatrix.
setViewMatrix(Matrix4 viewMatrix, Vector3 cameraPosition, Vector3 cameraFocusPosition, Vector3 upDirection) → void
Constructs an OpenGL view matrix in viewMatrix. View transformation is the inverse of the model transformation. View matrix is commonly used to compute the camera location/orientation into the full model-view stack.
smoothStep(double edge0, double edge1, double amount) double
Do a smooth step (hermite interpolation) interpolation with edge0 and edge1 by amount. The computation is equivalent to the GLSL function smoothstep.
unproject(Matrix4 cameraMatrix, num viewportX, num viewportWidth, num viewportY, num viewportHeight, num pickX, num pickY, num pickZ, Vector3 pickWorld) bool
On success, Sets pickWorld to be the world space position of the screen space pickX, pickY, and pickZ.

Typedefs

BarLifeTextBuilder = String Function(double life, double maxLife)
BoolCallback = bool Function()
CollisionCallback<T> = void Function(Set<Vector2> intersectionPoints, T other)
Can be used used to implement an onCollisionCallback or an onCollisionStartCallback.
CollisionEndCallback<T> = void Function(T other)
Can be used used to implement an onCollisionEndCallback.
ComponentSetFactory = ComponentSet Function()
ExternalBroadphaseCheck = bool Function(ShapeHitbox first, ShapeHitbox second)
ExternalMinDistanceCheck = bool Function(Vector2 activeItemCenter, Vector2 potentialCenter)
KeyHandlerCallback = bool Function(Set<LogicalKeyboardKey>)
The signature for a key handle function
MiniMapCustomRender<T extends GameComponent> = void Function(Canvas canvas, T component)
Created by
ParticleGenerator = Particle Function(int)
A function which returns a Particle when called.
ParticleRenderDelegate = void Function(Canvas c, Particle particle)
A function which should render desired contents onto a given canvas. External state needed for rendering should be stored elsewhere, so that this delegate could use it
ShapeBuilder = Shape Function(Vector2 size)
A function that creates a shape based on a size represented by a Vector2
SpawnerPositionBuilder = GameComponent Function(Vector2 position)
TileModelBuilder = TileModel Function(ItemMatrixProperties properties)