Commit Graph

3302 Commits

Author SHA1 Message Date
Lukas Klingsbo
3a9e0023be chore: Add funding links (patreon + buy me a coffee) (#1875)
Adds the links to our patreon and buy me a coffee in the pubspec files so that pub.dev can show them.
2022-09-01 16:45:54 +00:00
Luan Nico
9c5709fba1 chore: Upgrade the sdk and dartdoc versions to work with the current Flutter stable (#1881) 2022-09-01 16:26:33 +00:00
Lukas Klingsbo
abd28f28a6 feat: Add removeWhere to Component (#1878)
Since removeWhere will be removed from the ComponentSet in #1877 we should expose it on the component.
2022-08-30 21:02:08 +02:00
RutvikTak
b1a6dd18f2 docs: Added bouncing ball example in collision_detection examples and updated flame_forge2d to latest (#1868)
This PR adds two updates.

It updates the flame_forge2d to latest version i.e on pub.dev in examples and padracing projects.

Adds a bouncing ball example in the collision detection examples demonstrating a simple example of collision and bouncing of a ball from the walls around it.
2022-08-29 09:34:33 +00:00
Raul Mateo Beneyto
4ac683984a docs: more precise priority definition (#1870)
Updated docs about priority as we chat at #1457 (comment). I reused the same sentence as @st-pasha as it was easy to understand and I am not a native speaker.
2022-08-28 00:50:37 +02:00
Pasha Stetsenko
9457e38ebc feat(internal): Added RecycledQueue class (#1864)
This PR introduces RecycledQueue class, which is similar to a regular FIFO Queue except that it supports recycling of objects instead of having to create/delete them all the time.

This class will be used to build more efficient component lifecycle queues.
2022-08-26 16:43:17 +00:00
Pasha Stetsenko
00ab347c57 chore!: Remove functions/classes that were scheduled for removal in v1.3.0 (#1867)
This functionality should have been deleted before releasing version 1.3.0, but I guess we forgot ;), so better late than never.
2022-08-26 12:08:53 +02:00
Lukas Klingsbo
b22bc64384 feat: Possibility to ignore hitboxes for ray casting (#1863)
A lot of the time it is useful to be able to ignore certain hitboxes, if you are for example casting rays from within the hitbox of one of your components. This PR adds this functionality to raycast, raycastAll and raytrace.
2022-08-24 07:57:00 +00:00
Alejandro Santiago
44d17c64f8 refactor: used simpler and more implicit widgets in GameWidget (#1862)
Changes:

    Container for ColoredBox
    Container for SizedBox.shrink

Rationale:

    Avoid unnecessary checks.
    Be more implicit on the desired effect by using more specific widgets.
    Remove unnecessary checks made by Flutter by not following the above point.
    SizedBox can be const and won't even create a new instance during runtime.
2022-08-22 21:06:12 +02:00
Lukas Klingsbo
275ca17d7e docs: Updated itch.io instructions (#1858) 2022-08-21 16:31:53 -03:00
Erick
3855a63d34 doc: small fix on itch io instructions. (#1857) 2022-08-21 15:22:52 +00:00
Lukas Klingsbo
c58d4aac60 docs: itch.io web upload instructions (#1856) 2022-08-21 12:07:07 -03:00
John McDole
f444d512a1 docs: Fix missing header for TranslatedParticle (#1855) 2022-08-21 01:42:08 +00:00
tozu
b401c5485c docs: fix broken link for Keyboard Input Component (#1854) 2022-08-20 21:32:42 +00:00
Lukas Klingsbo
31d39f8670 docs: Fix broken link in forge2d readme (#1853) 2022-08-20 12:08:18 +02:00
Lukas Klingsbo
b96432d002 chore(release): publish packages (#1852) 1.3.0 2022-08-19 23:22:21 +02:00
Lukas Klingsbo
ed452dd172 feat!: Raycasting and raytracing (#1785)
This PR implements raytracing and raycasting for the built-in hitboxes.

If you pass in your own collision detection system to the HasCollisionDetection mixin you have to change the signature of that to: CollisionDetection<ShapeHitbox>instead of CollisionDetection<Hitbox>.
2022-08-19 22:44:18 +02:00
Pasha Stetsenko
e2de70c98a feat: Added ability to control overlays via the RouterComponent (#1840)
Class _ActiveOverlays renamed into OverlayManager and move into its own file. The class is still marked as internal.
    In GameWidget.controlled constructor the properties initialActiveOverlays and mouseCursor were missing, now added.
    Created class OverlayRoute for encapsulating an overlay-handling logic within the RouterComponent.
    New overlay builders can now be added to the game at runtime.
    The OverlaysManager._activeOverlays property is now a list instead of a set, so that the overlays would be displayed in the specific order requested by the user.
2022-08-19 17:10:39 +00:00
Pasha Stetsenko
8dd52c338b feat: PositionComponent now has a built-in Decorator (#1846)
This PR adds the decorator property to PositionComponent, and makes decorators chain-able. That is, decorators function as linked lists, and a new decorator can be appended to the end of such list, and later removed.

The PositionComponent starts with the default decorator: the Transform2DDecorator, which encapsulates the functionality which previously resided within the PositionComponent.renderTree. This allows to:

apply/remove additional visual effects via .decorator.addLast()/.removeLast();

replace the Transform2DDecorator with another one -- for example supporting skew, or isometric coordinates, or 3d rotations.

HasDecorator mixin can no longer be applied to a PositionComponent because it already has the decorator "built in".

The decorators Shadow3DDecorator and Rotate3DDecorator, when added to the PositionComponent, will now apply after the coordinate transform of the PositionComponent, as desired. This means that, for example, the shadow's base and rotation pivot point can be specified using the local coordinates of the component.
2022-08-19 14:29:46 +02:00
Pasha Stetsenko
f1b276e020 feat: Added routes that can return a value (#1848)
This PR introduces class ValueRoute<T> that can be used together with the RouterComponent in order to create routes that return a value. The most common example of such routes are dialog boxes.
2022-08-19 00:24:48 +02:00
Renan
38284902fa docs: Update tiled docs example link (#1845) 2022-08-15 17:12:33 +02:00
Calvin M.T
752cb47133 Add SpriteButton tap cancellation (#1844) 2022-08-15 08:48:13 +02:00
Lukas Klingsbo
eabf3feb84 chore(release): Publish flame_tiled v1.7.1
- flame_tiled@1.7.1
2022-08-11 12:51:28 +01:00
Pasha Stetsenko
bfdc3a291b feat: Structured text and text styles (#1830)
This PR introduces the notions of structured text, and text styles, to support rendering of rich text bodies.

Specifically, we recognize that sometimes in games one needs to render pieces of text that are larger than a single word or even a single paragraph. These pieces may include: books, quest descriptions, mission objectives, tutorials, in-game help system, dialogues, etc. Rendering such a piece of text is non-trivial, however. In order to tackle this problem, I break into the following parts:

Text structure, represented as a tree of Nodes. The nodes describe the logical structure of the text, for example the document may contain a header, and then several paragraphs, and a list, where the list contains some list items, some of which having possibly several paragraphs, etc. This structure is similar to how in HTML the text is marked up with HTML tags.

Text styles are struct-like classes that contain properties describing how the text is to be styled: font size, font renderer, borders, backgrounds, margins, padding, etc. This representation is also tree-like, so that for example text inside paragraphs can have different style than text within headers, and paragraphs within lists can have different margins. A text style is similar to a stylesheet in HTML.

Text elements are the result of applying the document style to a document node: they are the "prepared" and laid out pieces, ready to be rendered. Elements are a bit like mini-components, or perhaps text "particles" in a particle system.
2022-08-10 08:13:27 +00:00
DevKage
4ea12b724e fix: Remove unnecessary x offset (#1838)
There was an unnecessary offset applied to the canvas while processing image layers. It was causing the image to render outside the view. This PR removes that offset.
2022-08-10 07:55:16 +00:00
Pasha Stetsenko
24092bd72d feat: Added RouterComponent (#1755)
This PR adds the RouterComponent (see the docs for the description of its functionality).
2022-08-10 08:24:53 +02:00
Lukas Klingsbo
1cf3daf4bd chore(release): Publish flame_tiled 1.7.0 (#1837) 2022-08-09 18:32:36 +00:00
tomaszheng
54e40de674 fix: JoystickComponent drags using the delta Viewport (#1831)
JoystickComponent inherits from HudMarginComponent, and HudMarginComponent positionType= Viewport, so the delta here should use viewport.
2022-08-08 17:57:58 +02:00
Lukas Klingsbo
c306b30933 docs: Auto expand flame section on documentation home page (#1823) (#1826)
add an event listener to the docs site to listen everytime on load, then
expand the first expandable section ("flame") if the current page is
home page.
2022-07-28 12:19:37 +02:00
Pasha Stetsenko
eb6d0a9e47 docs: Fix disappearing menu in docs (#1825)
Fix docs bug introduced in #1817
2022-07-28 07:21:40 +00:00
Lukas Klingsbo
21b06a0fc0 docs: Revert auto expand flame section on documentation home page (#1824) 2022-07-27 23:39:50 +02:00
Sai Rajendra Immadi
f0b883be98 docs: Auto expand flame section on documentation home page (#1823)
add an event listener to the docs site to listen everytime on load, then
expand the first expandable section ("flame") if the current page is
home page.
2022-07-27 21:09:41 +02:00
Lukas Klingsbo
26196c0152 feat: Add Ray2 class to be used in raytracing/casting (#1788)
Introduces the Ray2 class which later will be used to see whether a ray intersects a hitbox.
2022-07-27 17:51:06 +02:00
Erick
4673c15f64 doc: Wrong syntax on forge2d docs. (#1821) 2022-07-26 13:21:59 +00:00
Anders Petersson
41b9d22aa6 docs: Fixed incorrect import in timer docs. (#1819) 2022-07-26 13:41:06 +02:00
Pasha Stetsenko
4b3169d1e1 docs: Menu on the left side can be expanded by clicking on arrow buttons (#1817)
This PR allows expanding folded menus in the documentation site without having to visit intermediate pages.
2022-07-25 11:58:21 +02:00
Ryuzaki
e9e7b0d598 feat: Add tertiary tap detector mixin (#1815)
This PR will add a new mixin on Game to detect tertiary tap (middle mouse button on desktop platforms) inputs.
2022-07-24 18:28:21 +02:00
Pasha Stetsenko
250d59992a docs: Improve navigation to internal links (#1813)
When navigating within the doc site, the target's header will no longer be obscured by the menu at the top of the page.
2022-07-24 13:13:11 +00:00
Pasha Stetsenko
68ef250a9f docs: Allow multiple infoboxes on a page to have code (#1814) 2022-07-24 01:17:51 +00:00
Pasha Stetsenko
0a41b2dabe feat: Added Shadow3DDecorator (#1812) 2022-07-24 03:11:22 +02:00
Ryuzaki
a5598a8fa4 fix: Delay camera update (#1811)
This PR delays the update for camera until all the components are updated to avoid the jitter effect. Here is a comparison of before and after
2022-07-23 20:06:48 +02:00
Pasha Stetsenko
f05194c80c feat: Added Rotate3DDecorator (#1805)
This PR creates a new Decorator for rotating a component in 3D.
2022-07-21 19:23:49 +02:00
Kurtis Melby
112acf2aa7 feat: Adding support for additional layer rendering options (#1794)
This PR expands the functionality of RenderableTileMap to include support for more than just simple TileLayer layers. Adding support for:

    ImageLayer rendering (note that tiled.dart was loading non-tile layers in the incorrect order until 0.8.4)
    layer parallaxX / parallaxY
    layer opacity
    map backgroundColor

tiled dependency

This PR relies on changes and bug fixes in tiled.dart 0.8.4
2022-07-21 15:16:05 +02:00
Pasha Stetsenko
7b04443046 perf: Use TextElements within the TextComponent (#1802)
TextElement is a class that caches the layout of a particular string of text. When drawing any text on the screen, it is important to convert it to text-elements and then cache those, especially if there are many text fragments being displayed simultaneously.

This PR changes the TextComponent class so that it computes and stores a TextElement instead of using TextRenderer.render() directly. This improves the performance of a game, as it avoids costly recalculations of the text layout on every game tick.
2022-07-21 09:25:15 +00:00
Doug Orchard
67be6ab862 docs: Fixing typo in FlameMultiBlocProvider dartdoc 2022-07-19 19:40:53 +02:00
Pasha Stetsenko
8d00847cfc feat: Added Decorator class and HasDecorator mixin (#1781)
The new class allows applying visual filters to canvas drawing operations. It is conceptually similar to the LayerProcessor class, except that it applies directly to a canvas instead of a Picture.

This functionality was extracted from PR #1755.

NB: the guitar image was taken from here, which is a public domain image, i.e. licensed under CC0 1.0.
2022-07-18 19:44:17 +00:00
Ahmet Enes Bayraktar
60daa196a8 fix: renderChain should allow open-ended chain drawing (#1804) 2022-07-18 21:36:36 +02:00
Sai Rajendra Immadi
e53b6337b9 docs: replace images in README with absolute path (#1796)
The images path under sponsors has a relative path from the repository, which are being changed to absolute path (starting with https)
2022-07-12 13:23:51 +02:00
Jochum van der Ploeg
80a633622a feat: add children argument to SpriteComponent.fromImage (#1793) 2022-07-09 21:58:16 +02:00
Lukas Klingsbo
d197870f52 feat: Add vector projection and inversion (#1787)
Adding projection, ìnvert and inverted to the vector extension.
v1.2.1
2022-07-09 20:00:07 +02:00