mirror of
https://github.com/flame-engine/flame.git
synced 2025-11-01 01:18:38 +08:00
feat!: Add CameraComponent to FlameGame (#2740)
This PR adds the `CameraComponent` and a `World` by default to the FlameGame.
This commit is contained in:
@ -17,14 +17,9 @@ starts to drop in FPS, this is without any sprite batching and such.
|
||||
final counterPrefix = 'Animations: ';
|
||||
final Random random = Random();
|
||||
|
||||
final world = World();
|
||||
late final CameraComponent cameraComponent;
|
||||
|
||||
@override
|
||||
Future<void> onLoad() async {
|
||||
cameraComponent = CameraComponent(world: world);
|
||||
addAll([cameraComponent, world]);
|
||||
await cameraComponent.viewport.addAll([
|
||||
await camera.viewport.addAll([
|
||||
FpsTextComponent(
|
||||
position: size - Vector2(0, 50),
|
||||
anchor: Anchor.bottomRight,
|
||||
|
||||
Reference in New Issue
Block a user