Commit Graph

3302 Commits

Author SHA1 Message Date
Erick
f75bd92e11 Adding dartdoc to flame_audio (#1105) 2021-11-18 11:31:02 +00:00
Lukas Klingsbo
12fd07e5ae Possibility to initialize all PositionComponents from onLoad (#1113)
* Fix ParallaxComponent constructor

* Fix sizing bug parallax_component

* Unify TextComponent and TextBoxComponent

* Fix tests

* Update PositionComponent docs

* Add changelog entry

* Apply suggestions from code review

Co-authored-by: Erick <erickzanardoo@gmail.com>

* Fix analyze issue

* Apply suggestions from code review

Co-authored-by: Luan Nico <luanpotter27@gmail.com>

* Fix line length in components.md

Co-authored-by: Erick <erickzanardoo@gmail.com>
Co-authored-by: Luan Nico <luanpotter27@gmail.com>
2021-11-18 11:42:12 +01:00
Erick
f777e1a0ea Adding dartdocs to flame tiled (#1104) 2021-11-18 09:47:29 +00:00
Lukas Klingsbo
795264edbf Unify mixin names (#1114) 2021-11-18 08:48:31 +01:00
Renan
85caf463f4 fix(NA): black frame when activating overlays (#1093)
* fix(NA): black flame when activating overlays

* more fixes

* Update packages/flame/lib/src/game/game_widget/game_widget.dart

Co-authored-by: Lukas Klingsbo <lukas.klingsbo@gmail.com>

* Update packages/flame/lib/src/game/game_widget/game_widget.dart

Co-authored-by: Lukas Klingsbo <lukas.klingsbo@gmail.com>

* Rename stuff

* call onremove on removing game from the widget tree

* update test

Co-authored-by: Lukas Klingsbo <lukas.klingsbo@gmail.com>
2021-11-17 10:36:56 +00:00
Pasha Stetsenko
394b39f0c4 Deprecate preRender/postRender (#1108)
* Deprecate preRender/postRender

* remove preRender and postRender

Co-authored-by: Lukas Klingsbo <lukas.klingsbo@gmail.com>
2021-11-17 10:23:18 +00:00
Pasha Stetsenko
bd36ef2f4f Fix documentation warnings (#1110)
Co-authored-by: Lukas Klingsbo <lukas.klingsbo@gmail.com>
2021-11-17 10:00:41 +00:00
Lukas Klingsbo
5c462090e9 Use FlameTester everywhere where it makes sense (#1106)
* Use FlameTester everywhere

* Move tests to flameGame

* Unify test text a bit

* Add changelog

* Use other enum in HasPaint tests

* Fix comments

* Fix projections test viewport

* Add visibleForTesting on FlameGameExtension
2021-11-17 10:13:58 +01:00
Luan Nico
950a7d6152 Improvements to isometric tilemaps (#1109)
* Improvements to isometric tilemaps

* Changelog

* Add test

* const block

* Fix example

* Update packages/flame/lib/src/components/isometric_tile_map_component.dart

Co-authored-by: Lukas Klingsbo <lukas.klingsbo@gmail.com>

* Update packages/flame/lib/src/components/isometric_tile_map_component.dart

Co-authored-by: Lukas Klingsbo <lukas.klingsbo@gmail.com>

* Update packages/flame/lib/src/components/isometric_tile_map_component.dart

Co-authored-by: Lukas Klingsbo <lukas.klingsbo@gmail.com>
2021-11-16 15:36:23 +01:00
Oleg Novosad
0b8fa3633b Made knob as a non-required field (#1099)
* Made knob as a non-required field

* Update CHANGELOG.md

* Updated per review commends from @spydon

* Updated per extra review comments from @spydon

* Changed joystick component to common implementation of extendable components.

* Background can be null so there is no need in assert.
2021-11-16 13:24:19 +01:00
Erick
abc29dbc58 Improving TimerComponent API (#1085)
* Improving TimerComponent API

* pr suggestion

* Update packages/flame/lib/src/components/timer_component.dart

Co-authored-by: Lukas Klingsbo <lukas.klingsbo@gmail.com>

* pr suggestion

* docs

* pr suggestions

* fixing

* renaming to onTick

* Update packages/flame/lib/src/components/timer_component.dart

Co-authored-by: Luan Nico <luanpotter27@gmail.com>

* Apply suggestions from code review

Co-authored-by: Lukas Klingsbo <lukas.klingsbo@gmail.com>

* fixing issues

* fixing flmae bloc isse

* more suggestions

* Update packages/flame/lib/src/timer.dart

Co-authored-by: Lukas Klingsbo <lukas.klingsbo@gmail.com>

Co-authored-by: Lukas Klingsbo <lukas.klingsbo@gmail.com>
Co-authored-by: Luan Nico <luanpotter27@gmail.com>
2021-11-15 14:55:18 +00:00
Lukas Klingsbo
520d51462b Change to the correct image in the component docs (#1100) 2021-11-15 15:20:14 +01:00
Lukas Klingsbo
69d9e5aa6b Check if anchor is already center before flipping (#1094)
* Check if anchor is already center

* Return if it is centered

* Update packages/flame/lib/src/components/position_component.dart

Co-authored-by: Pasha Stetsenko <stpasha@google.com>

* Simplify if

Co-authored-by: Pasha Stetsenko <stpasha@google.com>
2021-11-14 23:35:10 +01:00
Lukas Klingsbo
0e1c752df0 Unify tests to use FlameTester (#1095)
* Use FlameTester in collidable test

* Unify tests to use `FlameTester` where possible

* Added static test helper methods addAllUpdate and addUpdate

* Fix trailing comma

* Use extension instead of static methods

* Add missing await

* Renamed addUpdate to ensureAdd

* Update changelog
2021-11-14 23:04:56 +01:00
Pasha Stetsenko
39c9c55da1 Remove a file that was added to repo by accident (#1097) 2021-11-14 18:20:25 -03:00
Pasha Stetsenko
d7b51b9d50 Added Makefile to .gitignore (#1096) 2021-11-14 09:59:22 +01:00
Lukas Klingsbo
3cb23ef530 TextPaint to use TextStyle instead of TextPaintConfig (#1086)
* `TextPaint` to use `TextStyle` instead of `TextPaintConfig`

* Update packages/flame/lib/src/text.dart

Co-authored-by: Pasha Stetsenko <stpasha@google.com>

* Removed BaseTextConfig and TextPaintConfig

* Update text docs

* Apply suggestions from code review

Co-authored-by: Erick <erickzanardoo@gmail.com>

* Remove generics

* Update TextBoxExample

* Update text examples variable names

* Fix TextPaint in collision_detection example

Co-authored-by: Pasha Stetsenko <stpasha@google.com>
Co-authored-by: Erick <erickzanardoo@gmail.com>
2021-11-13 16:38:06 +01:00
Lukas Klingsbo
cd7a0bbb65 ShapeComponent and Hitbox to take transform of parents full ancestor tree into consideration (#1076)
* `ShapeComponent` changes size, position and angle of underlying Shape

* Added description to ShapeComponent

* Fix test

* Update packages/flame/lib/src/components/shape_component.dart

Co-authored-by: Erick <erickzanardoo@gmail.com>

* Add absoluteScale and absoluteAngle to PositionComponent

* Refactor ShapeComponent

* Should be scaled by total scale, not scaled size

* Premature optimization for creation for objects in Polygon

* Use path for default Polygon constructor

* Do not sync component and hitbox shape

* Fix analyze issue

* Add example for flipping with collision detection

* Don't use absoluteScale

* Fix examples

* Fix examples

* Doesn't need super.render

* Fix Circle dartdoc

* Update changelog

* Update names of vertices caches in Polygon

* Update text docs

* Revert "Update text docs"

This reverts commit 73a68a465d76eb0eb50bb3753e57b2f4e3b5a7f4.

* Fix examples

* ShapeComponents docs

* Move example games to the top

* Fix dartdoc comment about polygon vertex relation

* Fix order of polygon vertices in dartdoc

* Fix anchor for PolygonComponent.fromPoints

* Add test with ancestors

* Update doc/components.md

Co-authored-by: Pasha Stetsenko <stpasha@google.com>

* Update doc/components.md

Co-authored-by: Erick <erickzanardoo@gmail.com>

* Rename example classes

* Fix linting issues in examples

* Don't use px

* Use isTrue and isFalse

* Update doc/components.md

Co-authored-by: Erick <erickzanardoo@gmail.com>

* Fixed comments on PR

Co-authored-by: Erick <erickzanardoo@gmail.com>
Co-authored-by: Pasha Stetsenko <stpasha@google.com>
2021-11-13 16:00:24 +01:00
Lukas Klingsbo
d53ac50859 Add flame_lint to examples (#1090) 2021-11-12 10:35:56 +01:00
Pasha Stetsenko
3a60f25401 Fix typos&grammar in TextBoxComponent docs (#1091) 2021-11-12 09:05:45 +01:00
Lukas Klingsbo
0a7b87e202 Remove unnecessary super.render calls (#1084)
* Remove unnecessary super.render calls

* Update tutorial and docs
2021-11-11 11:50:01 +01:00
Bryan Oltman
ca7dc2af50 Fix typo in error message (#1087)
* Fix typo in error message

* Add change to CHANGELOG.md
2021-11-11 08:30:30 +00:00
Lukas Klingsbo
32bf19b91c Add random to the Color and Paint extensions (#1081)
* Add `randomColor` to the `Color` extension

* Add flame rive package to monorepo (#1048)

Add flame rive package to monorepo

* Add random to PaintExtension

* Update examples/pubspec.yaml

Co-authored-by: Erick <erickzanardoo@gmail.com>

Co-authored-by: Renan <6718144+renancaraujo@users.noreply.github.com>
Co-authored-by: Erick <erickzanardoo@gmail.com>
2021-11-10 13:09:12 +01:00
Pasha Stetsenko
92f3346966 Improvements to rendering pipeline (#1082)
* Improvements to rendering pipeline

* changelog note

* doc comment update

* Rephrase changelog note

* Added @mustCallSuper for preRender() / postRender()

* Added a comment

* flutter format
2021-11-10 10:36:23 +01:00
Lukas Klingsbo
d9131b5529 Update README.md 2021-11-09 23:17:26 +01:00
Renan
0f209309f0 Add flame rive package to monorepo (#1048)
Add flame rive package to monorepo
2021-11-09 10:58:36 +00:00
Luan Nico
1b81e056e6 Improved testing API (#1001) 2021-11-08 03:15:09 +00:00
Pasha Stetsenko
3abde23450 Move effects (#1077)
* Added MoveEffect

* formatting

* update comments

* Add example for move effects

* Added tests

* changelog

* flutter analyze

* avoid creating newPosition object

* added a trailing comma

Co-authored-by: Lukas Klingsbo <lukas.klingsbo@gmail.com>
2021-11-07 20:38:47 +00:00
Elias Reis
ec7d476375 adding example from sprite animation with variable step time (#1080)
Co-authored-by: Luan Nico <luanpotter27@gmail.com>
2021-11-07 00:18:16 +00:00
Lukas Klingsbo
0ce8200e4d Remove BaseComponent from docs (#1078)
Co-authored-by: Luan Nico <luanpotter27@gmail.com>
2021-11-06 23:15:41 +00:00
Erick
32b2c224b4 Fixing lint usage on Fire Atlas package (#1070) 2021-11-06 19:00:52 -04:00
Erick
bf666749c6 adding some docs about things out of the scope of Flame (#1069) 2021-11-06 20:21:28 +00:00
Lukas Klingsbo
2f37b09517 Add missing links and streamline versions in pubspec files (#1071) 2021-11-06 13:59:22 +01:00
Lukas Klingsbo
935a89992a Update PR template by removing script references (#1079) 2021-11-06 12:36:15 +01:00
Lukas Klingsbo
4e834f008f Streamline PositionComponent constructors (#1072)
* Streamline PositionComponents constructors

* TextBoxComponent doesn't handle size argument

* Add idle button onMount for HudButtonComponent

* Fix follow object example

* Updated dartdoc for HudButtonComponent
2021-11-05 14:28:28 +01:00
Luan Nico
f23f0702a4 Fix events + isHud (#1058) 2021-11-04 10:51:21 -04:00
Pasha Stetsenko
77c8813e6f Rename Hitbox -> HasHitboxes in the docs (#1073)
* Rename Hitbox -> HasHitboxes in the docs

* more renames

* more renames
2021-11-04 10:02:27 +01:00
Lukas Klingsbo
b7a2d3fdf8 Simplified the usage of ShapeComponent (#1068)
* Simplified the usage of ShapeComponent

* Default constructor for _RandomCircle

* Use default constructor

* Forced Anchor.center on ShapeComponent

* Fix examples using SquareComponent

* Removed unnecesary import

* Renamed edgeLength to size
2021-11-03 14:30:58 +01:00
Erick
b8ea25eceb Fixing Flame pause and resume engine features (#1066)
* Fixing Flame pause and resume engine features

* Update packages/flame/lib/src/game/mixins/game.dart

* Apply suggestions from code review

Co-authored-by: Lukas Klingsbo <lukas.klingsbo@gmail.com>

* Update doc/game.md

* Update doc/game.md

Co-authored-by: Lukas Klingsbo <lukas.klingsbo@gmail.com>
2021-11-02 23:08:53 +00:00
Erick
45b21c7c5f Adding CustomPainterComponent (#1067)
* Adding CustomPainterComponent

* Apply suggestions from code review

Co-authored-by: Lukas Klingsbo <lukas.klingsbo@gmail.com>
Co-authored-by: Jochum van der Ploeg <jochum@vdploeg.net>

* PR suggestions

Co-authored-by: Lukas Klingsbo <lukas.klingsbo@gmail.com>
Co-authored-by: Jochum van der Ploeg <jochum@vdploeg.net>
2021-11-02 19:56:16 -03:00
Pasha Stetsenko
e394ad0f35 Missing lint rules (#1062)
* proofread README

* Add missing lint rules

* Add question marks

* prefer_relative_imports

* Remove commented out rules

Co-authored-by: Lukas Klingsbo (spydon) <me@lukas.fyi>
Co-authored-by: Lukas Klingsbo <lukas.klingsbo@gmail.com>
2021-11-02 21:30:40 +01:00
Pasha Stetsenko
6e7e098f1b New Rotate effect (#1061)
* Added FlameAnimationController class

* Added MainAnimationController class

* Update doc comments

* formatting

* rename MainAnimationController

* Added tests for StandardAnimationController

* Added more tests

* comment

* Added changelog note

* Export StandardAnimationController

* formatting

* Use a default for 'curve' parameter

* rename onsetDelay -> startDelay

* Added Transofm2DEffect

* Added EffectComponent

* Added .transform getter

* formatting

* Rename EffectComponent -> Effect

* Add documentation for the Effect class

* minor

* Added a test for Effect class

* Adding tests for removeOnFinish

* Adding tests for onStart and onFinish

* Also check the effect after reset

* Fix-up merge

* formatting

* added doc-comments

* changelog note

* Added test for transform2DEffect

* Adjusted comments

* Make PositionComponent._transform public

* change changelog

* Adding RotateEffect

* wip on rotate2 example

* Rename -> RotateEffect2

* export rotation effect

* Finish example for RotateEffect2

* formatting

* rename RotateEffect2 -> RotateEffect

* Changelog note

* Added test file

* flutter format

* Remove a print() call

* _lastProgress moved to Transform2DEffect class

* remove avoid_print for now

* Moved description

* Initialize paints during construction

* Added a random test

* flutter format

Co-authored-by: Lukas Klingsbo <lukas.klingsbo@gmail.com>
2021-11-02 21:08:55 +01:00
Lukas Klingsbo
62c5ef4790 Fix HudMarginComponent onGameResize bug (#1064)
* Fix HudMarginComponent onGameResize bug

* Add tests for HudMarginComponent

* Update packages/flame/lib/src/components/input/hud_margin_component.dart

Co-authored-by: Jochum van der Ploeg <jochum@vdploeg.net>

Co-authored-by: Jochum van der Ploeg <jochum@vdploeg.net>
2021-11-02 20:29:18 +01:00
Lukas Klingsbo
da1e060594 Possibility to manually remove TimerComponent (#1065)
* Possibility to manually remove `TimerComponent`

* Fix example for TimerComponent

* Add dartdocs
2021-11-02 20:01:47 +01:00
Lukas Klingsbo
3a8abe139b Rename Hitbox mixin to HasHitboxes (#1060) 2021-11-02 12:44:21 +01:00
Pasha Stetsenko
d9984c7bda RemoveEffect (#1063)
* Added FlameAnimationController class

* Added MainAnimationController class

* Update doc comments

* formatting

* rename MainAnimationController

* Added tests for StandardAnimationController

* Added more tests

* comment

* Added changelog note

* Export StandardAnimationController

* formatting

* Use a default for 'curve' parameter

* rename onsetDelay -> startDelay

* Added Transofm2DEffect

* Added EffectComponent

* Added .transform getter

* formatting

* Rename EffectComponent -> Effect

* Add documentation for the Effect class

* minor

* Added a test for Effect class

* Adding tests for removeOnFinish

* Adding tests for onStart and onFinish

* Also check the effect after reset

* Fix-up merge

* formatting

* added doc-comments

* changelog note

* Added test for transform2DEffect

* Adjusted comments

* Make PositionComponent._transform public

* change changelog

* Added SimpleEffectController

* Added DestroyEffect

* Changelog note

* Rename DestroyEffect -> RemoveEffect

* Added example for RemoveEffect

* flutter format

* Move description of the RemoveEffectExample game

* move the description again

* minor
2021-11-02 09:59:35 +01:00
Erick
8446ca72bf docs: some steps to use gh pages (#1059)
* docs: some steps to use gh pages

* Update doc/platforms.md

* Apply suggestions from code review

Co-authored-by: Lukas Klingsbo <lukas.klingsbo@gmail.com>

Co-authored-by: Lukas Klingsbo <lukas.klingsbo@gmail.com>
2021-10-31 17:44:36 +00:00
Pasha Stetsenko
6d57bea13e Added Transform2DEffect class (#1052)
* Added FlameAnimationController class

* Added MainAnimationController class

* Update doc comments

* formatting

* rename MainAnimationController

* Added tests for StandardAnimationController

* Added more tests

* comment

* Added changelog note

* Export StandardAnimationController

* formatting

* Use a default for 'curve' parameter

* rename onsetDelay -> startDelay

* Added Transofm2DEffect

* Added EffectComponent

* Added .transform getter

* formatting

* Rename EffectComponent -> Effect

* Add documentation for the Effect class

* minor

* Added a test for Effect class

* Adding tests for removeOnFinish

* Adding tests for onStart and onFinish

* Also check the effect after reset

* Fix-up merge

* formatting

* added doc-comments

* changelog note

* Added test for transform2DEffect

* Adjusted comments

* Make PositionComponent._transform public

* change changelog
2021-10-31 14:43:32 +01:00
sharyari
a55fc29baa clarified TimerComponent example (#1057) 2021-10-30 17:42:42 +02:00
Luan Nico
b50f527830 Make the publish script work with packages without example (#1055) 2021-10-29 22:13:05 -04:00