Created
January 11, 2025 04:08
-
-
Save crcdng/862027222ac03074bf321a72f2097907 to your computer and use it in GitHub Desktop.
Size vs FlameGame().size
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library; | |
import 'package:flame/camera.dart'; | |
import 'package:flame/game.dart'; | |
import 'package:flutter/material.dart'; | |
void main() { | |
final game = MyGame(); | |
runApp(GameWidget(game: game)); | |
} | |
class MyGame extends FlameGame { | |
MyGame() | |
: super( | |
camera: CameraComponent.withFixedResolution( | |
width: 1920, | |
height: 1080, | |
)); | |
@override | |
void onGameResize(Vector2 size) { | |
super.onGameResize(size); | |
print("onGameResize ${size}"); | |
print("onGameResize ${this.size}"); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment