Commit Graph

3302 Commits

Author SHA1 Message Date
Lukas Klingsbo
c7c4480d79 chore(release): publish packages (#1789)
* chore(release): publish packages

 - flame@1.2.1
 - flame_audio@1.3.0
 - flame_test@1.6.0
 - flame_bloc@1.6.0
 - flame_fire_atlas@1.2.0
 - flame_flare@1.3.0
 - flame_forge2d@0.12.1
 - flame_lint@0.1.1
 - flame_oxygen@0.1.4
 - flame_rive@1.5.0
 - flame_svg@1.4.0
 - flame_tiled@1.6.0

* Update packages/flame/CHANGELOG.md
2022-07-08 13:41:14 +02:00
Lukas Klingsbo
e86630ae00 fix: Correct the imports for the padracing -> dartpad script (#1786)
After a previous update to padracing I forgot to update the script that turns it into a file that can be put into DartPad.
2022-07-08 10:33:19 +02:00
Pasha Stetsenko
0ccb0e2ef5 perf!: Game.images/assets are now same as Flame.images/assets by default (#1775)
The caches Game.images and Game.assets now coincide with the static caches Flame.images and Flame.assets by default.

This aims to avoid the situation where the same image (asset) may be loaded twice into two separate caches without the user noticing.
2022-07-07 18:42:20 +00:00
Victor Ogundola
85cd60e16c feat: New colours to pallete.dart (#1783)
added 20 new colors and the colors are in alphabetical order.
2022-07-04 14:35:47 +02:00
Pasha Stetsenko
8e41d83ea4 feat: Added size parameter for testGolden() (#1780)
Added size parameter to testGolden() function, allowing us to reduce the size of the game canvas used. The default size is 2400x1800, as given by the Flutter framework, seems like too much for most tests.
2022-07-03 10:34:12 +02:00
Pasha Stetsenko
58571141bc docs: Added ability to create infobox-style widgets in the documentation (#1771)
Additional mode "infobox" allows Flutter widgets to be inserted into the generated documentation site as wikipedia-style infoboxes floating on the right. This is useful for presenting content to the user up-front without sacrificing the flow of the exposition. For example, currently the Tap Events demo is "hidden" in the middle of a long page.

We believe that presenting the content in this way would make the user more excited to read about it.
2022-07-02 01:02:19 +02:00
Hwanseok Barth Kang
dcdfc02762 Change elapsed time to be using microsecond since epoch (#1767) 2022-07-01 12:39:15 +00:00
Erick
79d98d6f56 chore: Bump examples dashbook (#1766)
Updates the Dashbook version on our examples and update an example to use its new action API.
2022-07-01 09:48:43 +02:00
Pasha Stetsenko
82f75fcb57 fix: Specify size for the SpriteWidget (#1760)
Co-authored-by: Erick <erickzanardoo@gmail.com>
2022-06-29 23:17:35 +02:00
Pasha Stetsenko
c5083501d5 refactor!: Matcher closeToVector() now accepts Vector2 as an argument (#1761)
This PR changes the signature of the closeToVector() helper function:

    Old: closeToVector(num x, num y, {double epsilon = 1e-15})
    New: closeToVector(Vector2 vector, [double epsilon = 1e-15])
v1.3.0
2022-06-29 17:38:53 +00:00
Hwanseok Barth Kang
eb0701951c fix: SpriteAnimationWidget can now be update animation safely (#1738)
* Replace SingleTickerProviderStateMixin to TickerProviderStateMixin

* Adding failing test

* Re-use the animation controller

* Add some tests

* Remove redundant removing listener

Co-authored-by: Erick <erickzanardoo@gmail.com>
2022-06-29 12:50:21 +00:00
Pasha Stetsenko
9f35b15420 fix: Overlays can now be properly added during onLoad (#1759)
* fix overlays being set in onLoad

* added tests
2022-06-29 09:43:39 -03:00
Erick
6a2356aa5e docs: updating README to the new flame bloc version (#1737)
* docs: updating README to the new version

* Apply suggestions from code review

Co-authored-by: Felix Angelov <felangelov@gmail.com>

* suggestions

Co-authored-by: Jochum van der Ploeg <jochum.vanderploeg@verygood.ventures>
Co-authored-by: Felix Angelov <felangelov@gmail.com>
2022-06-28 00:34:10 +00:00
Pasha Stetsenko
02d0b71b23 docs: Klondike tutorial, part 4 (#1740)
This PR adds step 4 for the Klondike tutorial: "Gameplay".
2022-06-27 20:31:23 +00:00
Pasha Stetsenko
c44272be45 feat: Added TextFormatter classes (#1720)
A TextFormatter is a class that can take a string of text and convert it into a TextElement.
    A TextElement is an object that encapsulates a text string prepared for rendering. This object knows its own dimensions (layout), and is able to render itself on a canvas.

A TextFormatter is different from the current TextRenderer in one crucial respect: whereas TextRenderer takes a string of text and draws it onto the canvas directly (performing the layout and measurement internally), the TextFormatter creates an object that encapsulates the information necessary for rendering.

Thus, TextFormatter's output can be used to prepare the text once, and then render multiple times. In addition, since each TextElement knows its own layout, -- these individual layouts can be collected, manipulated, and arranged into a larger text body necessary for rich text rendering.

In addition, this PR:

    Implements a debug version of the standard text renderer, which draws rectangles instead of text;
    Re-enables the skipped golden test for the TextBoxComponent (hopefully it'll work this time);
    Refactors existing TextRenderers to use the new TextFormatters under the hood.

This PR is a WIP for the Rich Text functionality (#1627).
2022-06-27 18:06:14 +00:00
Lukas Klingsbo
8384a51d65 docs: Simplify draggable example (#1754)
The draggable example was overly complicated so I simplified it.
2022-06-27 14:57:58 -03:00
Luan Nico
b956ef17b5 doc: Fix dangerous typo on flame_lint docs (#1756) 2022-06-26 21:17:26 +00:00
Pasha Stetsenko
5225a4ebd5 refactor: Game is now a class, not a mixin (#1751)
This simple refactor allows us to write class MyGame extends Game, instead of a more awkward class MyGame with Game. However, using ... with Game still continues to work, so no changes necessary for the users.
2022-06-25 21:32:32 +00:00
Pasha Stetsenko
20f169cadb docs: Fix search in documentation (#1753)
Upgrading doctools.js script to the latest version used in Sphinx.
After this change, the search script should work again.
2022-06-25 23:26:49 +02:00
Pasha Stetsenko
7e79638dd5 perf: Avoid unnecessary copy in AssetsCache.readBinaryFile (#1749)
Co-authored-by: Erick <erickzanardoo@gmail.com>
2022-06-24 12:58:45 +00:00
Pasha Stetsenko
b69e8d85c7 refactor: Use new "super"-constructors in ShapeComponents (#1752)
This is a minor refactor to make the constructors look simpler.
2022-06-24 10:14:59 +02:00
AdamCYH
c175617714 fix: Camera incorrect follow with zoom and world boundaries
When the camera follows a component with world boundaries and zoom, the camera is incorrectly positioned.
I think it is because world boundaries already consider the zoom and it will never be greater than gameSize * zoom.
2022-06-22 18:23:58 +00:00
Lukas Klingsbo
3cefa95342 chore(release): publish packages (#1743)
- flame_rive@1.4.0

Co-authored-by: Erick <erickzanardoo@gmail.com>
2022-06-22 17:52:42 +00:00
Lukas Klingsbo
72e317f898 fix: Fix broken link for example games code (#1747) 2022-06-22 17:46:47 +00:00
Hwanseok Barth Kang
01ed2ec967 fix: Correct key events in GameWidget.controller (#1745)
Fixes #1744
2022-06-21 20:30:09 +00:00
Luan Nico
e97893f94b chore: Update minor version of audioplayers (#1742)
Update minor version of audioplayers, which fixes a couple bugs
2022-06-19 12:47:59 +02:00
Pasha Stetsenko
f750d705d1 fix: World component can now be queried with componentsAtPoint (#1739)
The componentsAtPoint function allows us to find a component located at a specific position. Usually it is applied to the top-level Game, but there are instances when it could also be useful to apply this function to the World component. This PR enables such functionality.
2022-06-19 01:19:22 +00:00
Norberto Martín Afonso
82e4be96f3 fix: Flame_rive now can load Nested Artboards and update to 0.9.0 rive package (#1741)
Is a solution to Closes #1692 and updatting to rive 0.9.0 flutter package
2022-06-19 03:12:35 +02:00
Iman khoshabi
1dc313f301 docs: Return Widget instead of void in the game_widget.md (#1736)
The return type of GameWidget docs should be Widget instead of void
2022-06-16 12:04:45 +02:00
AdrienDelgado
3d19caa36d feat: Adding bloc getter to FlameBlocListenable mixin (#1732)
This PR adds a getter to the FlameBlocListenable mixin. This getter will allow to use FlameBlocListenable as a standalone mixin to react to new states via onNewState(), access the current state, and also add events to the listenable Bloc via the bloc property.
Currently a workaround to give components this functionality is to use FlameBlocListenable and FlameBlocReader in parallel.
2022-06-15 06:18:49 +00:00
Lukas Klingsbo
c738384314 fix: Correct flutter constraint (#1731)
Pub gives a warning when using ^3.0.0 since that also implies less than 4.0.0, which your Flutter dependency shouldn't be.
With >= it is an open range instead.
2022-06-14 19:59:01 -04:00
Lukas Klingsbo
7c653a60a2 chore: Publish flame_audio 1.2.0 (#1730)
* chore(release): publish packages

 - flame_audio@1.2.0

* fix: flame_audio should not have upper Flutter bound
2022-06-14 20:18:52 +02:00
Pasha Stetsenko
10669c1270 feat: Drag events that dispatch using componentsAtPoint (#1715)
Implement drag events that dispatch using the componentsAtPoint mechanism.
2022-06-14 14:52:21 +00:00
Pasha Stetsenko
ea354e3a81 docs: Documenting how to write documentation (#1721)
Since our documentation is fairly complex, we need to have a document which describes how various parts of it work. This PR adds such documentation.
2022-06-14 16:45:48 +02:00
Pasha Stetsenko
197e63d69e fix: ButtonComponent behavior when the engine is paused (#1726)
- In Component, we will now avoid adoption queue when setting parent to the same as the current;
- The ButtonComponent avoids swapping button and buttonDown components if buttonDown is null;
2022-06-14 08:43:15 +02:00
strangeFE
8306fc1104 fix: tiled example size (#1729) 2022-06-14 01:18:20 -04:00
Lukas Klingsbo
e59f342846 fix: Add missing paint arguments on shapes (#1727) 2022-06-14 04:48:27 +00:00
Lukas Klingsbo
ccf32e0787 ci: Use pubspec_overrides.yaml (#1728)
Since Flutter 3.0.0 we can use Melos feature for modifying the pubspec_overrides.yaml files instead of hacking around with the pubspec.lock files.
2022-06-14 04:20:05 +00:00
Luan Nico
d6bf920d28 feat!: Update flame_audio to AP 1.0.0 (#1724) 2022-06-14 00:12:47 -04:00
Jochum van der Ploeg
987a44f441 feat: add HasAncestor mixin (#1711) 2022-06-12 11:54:11 +00:00
Pasha Stetsenko
f08f8e12f5 fix: Merge basic and advanced gesture detectors (#1718)
The "basic" gesture detectors widget was creating a RawGestureDetector underneath, which resulted in two nested RawGestureDetectors, each with its own gesture arena.

This refactor combines the two gesture detectors into a single one.
2022-06-11 23:11:00 +02:00
Lukas Klingsbo
7aeb2c4ad4 chore: Cache flutter in pipeline (#1717)
Co-authored-by: Jochum van der Ploeg <jochum.vanderploeg@verygood.ventures>
2022-06-09 13:06:57 +00:00
Lukas Klingsbo
07fbe8b277 chore: publish flame_lint (#1716)
Since flame_lint was accidentally missed in the release yesterday.
2022-06-09 14:59:09 +02:00
Lukas Klingsbo
2a41d0d683 feat: Move to Flutter 3.0.0 and Dart 2.17.0 (#1713)
This upgrades all packages to Flutter 3.0.0 and fixes all analyze issues that came from that.
2022-06-08 06:04:40 +00:00
Lukas Klingsbo
ad602ff963 chore: v1.2.0 changelogs (#1712)
* chore(release): publish packages

 - flame@1.2.0
 - flame_audio@1.1.0
 - flame_bloc@1.5.0
 - flame_fire_atlas@1.1.0
 - flame_flare@1.2.0
 - flame_forge2d@0.12.0
 - flame_oxygen@0.1.3
 - flame_rive@1.3.0
 - flame_svg@1.3.0
 - flame_test@1.5.0
 - flame_tiled@1.5.0
v1.2.0 1.2.0
2022-06-07 16:52:55 +02:00
Luan Nico
bd2ef967e1 fix: Fix flame package example app (#1709) 2022-06-07 15:54:55 +02:00
Luan Nico
94cc115a9e refactor: Remove unecessary copy operation on Camera (#1708) 2022-06-07 06:01:47 -04:00
Lukas Klingsbo
1efd067e31 fix: Remove nonVirtual method shouldRemove (#1707) 2022-06-07 11:43:27 +02:00
Pasha Stetsenko
c34456b3f2 chore: Fix some of the remaining lint problems (#1706)
Fix warnings raised by the avoid_void_async lint rule;

Remove rule use_enums, which is not available in Dart 2.16
2022-06-07 07:33:04 +02:00
Lukas Klingsbo
b60c54b9fa chore: Runs the tests with Spec for clearer output (#1704) 2022-06-06 20:26:06 +00:00