GameComponentExtensions extension
Methods
-
addParticle(Particle particle, {Vector2? position, Vector2? size, Vector2? scale, double? angle, Anchor? anchor, int? priority, ComponentKey? key})
→ void
-
Used to add particles in your component.
-
directionThePlayerIsIn()
→ Direction?
-
-
generateValues(Duration duration, {double begin = 0.0, double end = 1.0, Curve curve = Curves.linear, Curve? reverseCurve, bool autoStart = true, bool infinite = false, VoidCallback? onFinish, ValueChanged<double>? onChange})
→ ValueGeneratorComponent
-
Used to generate numbers to create your animations or anythings
-
getAngleFromTarget(GameComponent target)
→ double
-
Get angle between this comp to target
-
getComponentDirectionFromMe(GameComponent comp)
→ Direction
-
-
globalToViewportPosition(Offset position)
→ Offset
-
-
loadCameraParallaxComponent(Iterable<ParallaxData> dataList, {Vector2? baseVelocity, Vector2? velocityMultiplierDelta, ImageRepeat repeat = ImageRepeat.repeatX, Alignment alignment = Alignment.bottomLeft, LayerFill fill = LayerFill.height, Images? images, Vector2? position, Vector2? size, Vector2? scale, double? angle, Anchor? anchor, int? priority, FilterQuality? filterQuality, ComponentKey? key})
→ Future<ParallaxComponent<FlameGame<World>>>
-
-
loadParallaxComponent(Iterable<ParallaxData> dataList, {Vector2? baseVelocity, Vector2? velocityMultiplierDelta, ImageRepeat repeat = ImageRepeat.repeatX, Alignment alignment = Alignment.bottomLeft, LayerFill fill = LayerFill.height, Images? images, Vector2? position, Vector2? size, Vector2? scale, double? angle, Anchor? anchor, int? priority, FilterQuality? filterQuality, ComponentKey? key})
→ Future<ParallaxComponent<FlameGame<World>>>
-
-
overlaps(Rect other)
→ bool
-
-
showDamage(double damage, {TextStyle? config, double initVelocityVertical = -5, double initVelocityHorizontal = 1, double gravity = 0.5, double maxDownSize = 20, DirectionTextDamage direction = DirectionTextDamage.RANDOM, bool onlyUp = false})
→ void
-
Add in the game a text with animation representing damage received
-
simpleAttackMeleeByAngle({dynamic id, Future<SpriteAnimation>? animation, required double damage, required double angle, required AttackOriginEnum attackFrom, required Vector2 size, bool withPush = true, double marginFromCenter = 0, Vector2? centerOffset, void onDamage(Attackable attackable)?})
→ void
-
Execute simple attack melee using animation
-
simpleAttackMeleeByDirection({Future<SpriteAnimation>? animationRight, dynamic id, required double damage, required Direction direction, required Vector2 size, required AttackOriginEnum attackFrom, bool withPush = true, double? sizePush, double? marginFromCenter, Vector2? centerOffset, void onDamage(Attackable attackable)?})
→ void
-
Execute simple attack melee using animation
-
simpleAttackRangeByAngle({required Future<SpriteAnimation> animation, required Vector2 size, required double angle, required double damage, required AttackOriginEnum attackFrom, Vector2? destroySize, Future<SpriteAnimation>? animationDestroy, dynamic id, double speed = 150, bool withDecorationCollision = true, VoidCallback? onDestroy, ShapeHitbox? collision, LightingConfig? lightingConfig, double marginFromOrigin = 16, Vector2? centerOffset})
→ void
-
Execute the ranged attack using a component with animation
-
simpleAttackRangeByDirection({required Future<SpriteAnimation> animationRight, required Vector2 size, required Direction direction, required AttackOriginEnum attackFrom, Vector2? destroySize, dynamic id, double speed = 150, double damage = 1, bool withCollision = true, VoidCallback? onDestroy, ShapeHitbox? collision, LightingConfig? lightingConfig, Future<SpriteAnimation>? animationDestroy, double marginFromOrigin = 16, Vector2? centerOffset})
→ void
-
Execute the ranged attack using a component with animation
-
viewportPositionToGlobal(Offset position)
→ Offset
-