Skip to content

Instantly share code, notes, and snippets.

@crcdng
Created January 11, 2025 04:08
Show Gist options
  • Save crcdng/862027222ac03074bf321a72f2097907 to your computer and use it in GitHub Desktop.
Save crcdng/862027222ac03074bf321a72f2097907 to your computer and use it in GitHub Desktop.
Size vs FlameGame().size
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