276 Commits

Author SHA1 Message Date
a8ef5cadea 👌 Use Offset type directly in JoystickAction.update calculations (#631) 2021-01-17 21:37:46 -03:00
c462dd6913 Making SpriteComponent and SpriteAnimationComponent follow the same standard for empty constructors (#620) 2021-01-17 11:31:15 -03:00
16eaef3bb1 🏷 Backport some code improvements from the null-safety branch (#603) 2021-01-08 23:25:29 -03:00
af53438cd4 Refactor ParallaxComponent (#613)
* Simplified loading of ParallaxComponent

* Loading helpers for the different Parallax parts

And refactor how the delta velocity works

* Fix formatting

* Break out Parallax out of ParallaxComponent

* Fix docs

* Add extension for loading different parallax things on game

* Fix formatting

* Add loadParallaxComponent extension

* Fix formatting
2021-01-06 21:07:31 +01:00
95f2847f06 [fix-remove-children-issue] BaseComponent removes children marked as shouldRemove during update (#600)
Co-authored-by: Lukas Klingsbo <lukas.klingsbo@gmail.com>
2021-01-03 22:48:29 +01:00
480990265b BaseComponent should return immutable chlidren iterable (#594)
* Add changelog entry

* Change to Iterator to minimize performance hit

* Revert "Change to Iterator to minimize performance hit"

This reverts commit e7260aa507d4a57441e798ee0ba40cd09a776417.

* Return UnmodifiableListView for children

* Update changelog

* Add generics

* Links in comment for children getter
2020-12-29 16:32:19 +01:00
a6eb12202a Fix issue in BaseComponent where addChild results in a TypeError (#593)
* [fix-add-child-issue] Fix issue in BaseComponent where addChild results in a TypeError

* [fix-add-child-issue] Change to using internal children set throughout BaseComponent
2020-12-28 20:22:39 +01:00
18d04c13c0 Remove Resizable mixin (#589)
* Remove Resizable mixin

* Update examples and changelog

* Fixed formatting

* Remove unused import
2020-12-22 15:55:29 +01:00
dfb3a71c4f Use config defaults for TextBoxComponent (#588) 2020-12-22 15:50:10 +01:00
692213d5a4 Properly propagate onMount and onRemove to children (#579)
* Fix rendering of children

* Game loop handles other restore

* Properly propagate onMount and onRemove to children

* Use BaseGame on gestures to minimize confusion

* Fix linting

* All children don't need preparation

* Add composability example

* gameRef might not be defined

* Add mustCallSuper

* isMounted on game

* Remove unused gameRef argument

* Made isMounted only modifiable by the component

* Move dartdoc to public isMounted

* Fix formatting
2020-12-21 12:42:45 +01:00
7a81b029cb Fix rendering of children (#578)
* Fix rendering of children

* Game loop handles other restore
2020-12-20 21:23:58 +01:00
bd8257402b Rename Dragable -> Draggable (#575)
* Rename Dragable -> Draggable

* Hide ambigious class

* Add changelog entry

* Update docs
2020-12-19 01:10:17 +01:00
bde8656510 Adding some fixes from PR comments 2020-12-12 18:28:00 +00:00
11628b1edb Adding tests and handling composed components 2020-12-12 18:28:00 +00:00
48f3dee9a9 Adding immediate inclusion components 2020-12-12 18:26:52 +00:00
e478296634 Implementing onLoad 2020-12-12 18:26:20 +00:00
17cbe5221f Adding proposal for onLoad 2020-12-12 18:23:42 +00:00
f917920f45 Fix children update and rendering (#565)
* Fix children update and rendering

* Add changelog

* Fix formatting

* Add note about addChildren and remove assert

* Re-add child.rendered test

* Add MockCanvas and use it for composed test
2020-12-11 13:14:36 +01:00
b2015999b7 Handle order of propagation for Dragable 2020-12-09 10:22:36 +00:00
463c30c374 Support dragable components 2020-12-09 10:22:36 +00:00
8d7dd46806 PR suggestions 2020-12-09 10:10:13 +00:00
4f7c1065e5 Fixing animation example 2020-12-09 10:10:12 +00:00
4939b708dd Address comments 2020-12-09 10:10:12 +00:00
386ff94787 Address comments 2020-12-09 10:10:12 +00:00
842e53b8ce . 2020-12-09 10:10:12 +00:00
4f989e49f5 Unify multiple render methods on Sprite 2020-12-09 10:10:12 +00:00
ddaa8b296e Generic way of handling tap events 2020-12-09 10:10:12 +00:00
a47f62b018 Add explanation to assert 2020-12-09 10:10:12 +00:00
1c36b6ebf1 Use relative import 2020-12-09 10:10:12 +00:00
c4e2021b6c Components with a gameRef doesn't require it as argument
For the addChild method
2020-12-09 10:10:12 +00:00
1ceb7d3ee6 Fix dartdoc of ParticleComponent 2020-12-09 10:10:12 +00:00
02e4563051 Update Components docs 2020-12-09 10:10:12 +00:00
98ad12d269 Use relative imports 2020-12-09 10:10:12 +00:00
46554507a7 Tapables need to be handled in reversed priority order 2020-12-09 10:10:11 +00:00
2818845f7e propagateToChildren should not handle this, only children 2020-12-09 10:10:11 +00:00
00e331b11e Update BaseComponent description 2020-12-09 10:10:11 +00:00
7f16df3a3a Children should be private 2020-12-09 10:10:11 +00:00
e8ee7a3a82 Move relevant parts from PositionComponent to BaseComponent 2020-12-09 10:10:11 +00:00
cf68a32c1b Keep component unopinionated 2020-12-09 10:10:11 +00:00
8665172ed9 Take angle into account for taps 2020-12-09 10:10:11 +00:00
1317532210 fix _debugPaint stroke width for web 2020-12-09 10:07:35 +00:00
d09d2bd449 Add TextBoxConfig options and fix TextBoxComponent bugs (#534)
* Add TextBoxConfig options and fix TextBxoComponent bugs

* Add changelog entry

* Fix snackbar deprecation

* All examples to have publish to none

* One argument per line

* No explicit types for local variables

* Cache the width

* Fix formatting
2020-12-09 10:07:35 +00:00
e64b1699c2 Default priority from constructor 2020-11-17 22:00:30 +01:00
61ac24f6d4 Keep priority final since it doesn't do any changes later 2020-11-16 22:19:05 +01:00
81eaf05b22 Use booleans instead of methods for simple values 2020-11-15 18:56:17 +01:00
4a3f9778a4 destroy -> remove for components 2020-11-15 14:54:35 +01:00
0135f93493 Simplify BaseGame interactions 2020-11-15 01:18:49 +01:00
9e2f121e0f No explicit type on internal variables 2020-11-12 22:20:06 +01:00
b07d433bd2 Fix parallax component 2020-11-11 21:55:31 +01:00
39c2663798 Function for set component to init state 2020-11-07 15:21:21 +01:00