Created
January 11, 2025 03:46
-
-
Save crcdng/3666dd3718a8e0be342901ebb2c8d828 to your computer and use it in GitHub Desktop.
Flame setting 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"); | |
} | |
@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