网页
综合
更新时间 2026-11-14 15:56:24
flame changelog | Flutter package
自动蜘蛛
pub.dev
正文约 3485 字
A minimalist Flutter game engine, provides a nice set of somewhat independent modules you can choose from.
Note: This release has breaking changes.
Note: This release has breaking changes.
Note: This release has breaking changes.
Note: This release has breaking changes.
Note: This release has breaking changes.
Note: This release has breaking changes.
Note: This release has breaking changes.
Note: This release has breaking changes.
Note: This release has breaking changes.
Note: This release has breaking changes.
Note: This release has breaking changes.
Note: This release has breaking changes.
To specify start and end opacities for ColorEffect use the optional named parameters opacityFrom and opacityTo. So offset.dx should be set as opacityFrom and offset.dy should be set as opacityTo.
Note: This release has breaking changes.
In this release the old camera system was renamed to oldCamera and replaced by a default World and a CameraComponent which is now named camera.
To migrate from the old system:
Instead of adding the components directly to your game with add, add them to the world, this will make the CameraComponent responsible for rendering them instead of the game directly.
(Optional) If you want to add a HUD component, instead of using PositionType, add the component as a child of the viewport.
(Optional) If you want to have a specificly set up CameraComponent in your game from the start you can pass in a camera to the constructor.
(Optional) A lot of the time it is no longer necessary to extend FlameGame, you can instead build your game or level by extending the World and pass it in to the FlameGame.
Note: This release has breaking changes.
Note: This release has breaking changes.
Note: This release has breaking changes.
In the future (maybe as early as v1.9.0) this camera will be removed, please use the CameraComponent instead.
This is the simplest way of using the CameraComponent:
Add variables for a CameraComponent and a World to your game class
In your onLoad method, initialize the cameraComponent and add the world to it.
Instead of adding the root components directly to your game with add, add them to the world.
(Optional) If you want to add a HUD component, instead of using PositionType, add the component as a child of the viewport.
Note: This release has breaking changes.
If you have components that rely on receiving onGameResize calls before they load, then you can retrieve the game's size in onLoad manually via findGame()!.size.
The HasDraggableComponents mixin is now empty & deprecated. If your game used this mixin overriding its methods onDragStart, onDragUpdate, etc -- then they will no longer work. If you want to receive drag events at the top level of the game, then simply add a DragCallbacks component to the top level of the game.
The HasTappableComponents mixin is now empty & deprecated. If your game used this mixin overriding its methods onTapDown, onTapUp, etc -- then they will no longer work. If you want to receive tap events at the top level of the game, then simply add a TapCallbacks component to the top level of the game.
Note: This release has breaking changes.
Note: This release has breaking changes.
Note: This release has breaking changes.
REFACTOR: move broadphase-related functionality into separate subdirectory (#1943). (f23acd41)
REFACTOR: used simpler and more implicit widgets in GameWidget (#1862). (44d17c64)
PERF: SpriteAnimationWidget will re-render only when needed (#1876). (bb678301)
本页为82搜索生成的网页快照,内容来自站内索引;演示数据的原文链接仅作示例。