Skip to content

Instantly share code, notes, and snippets.

@crcdng
Created January 11, 2025 03:46
Show Gist options
  • Save crcdng/3666dd3718a8e0be342901ebb2c8d828 to your computer and use it in GitHub Desktop.
Save crcdng/3666dd3718a8e0be342901ebb2c8d828 to your computer and use it in GitHub Desktop.
Flame setting 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");
}
@override
void onLoad() {
super.onLoad();
print("onLoad $size");
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment