MyGit

v1.8.0

flame-engine/flame

版本发布时间: 2023-05-29 23:01:19

flame-engine/flame最新发布版本:v1.22.0(2024-11-25 18:46:44)

1.8.0

Note: This release has breaking changes.

Migration instructions

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:

  1. Add variables for a CameraComponent and a World to your game class

    final world = World();
    late final CameraComponent cameraComponent;
    
  2. In your onLoad method, initialize the cameraComponent and add the world to it.

    @override
    void onLoad() {
      cameraComponent = CameraComponent(world: world);
      addAll([cameraComponent, world]);
    }
    
  3. Instead of adding the root components directly to your game with add, add them to the world.

    world.add(yourComponent);
    
  4. (Optional) If you want to add a HUD component, instead of using PositionType, add the component as a child of the viewport.

    cameraComponent.viewport.add(yourHudComponent);
    

相关地址:原始地址 下载(tar) 下载(zip)

查看:2023-05-29发行的版本