Last active
November 25, 2023 15:26
-
-
Save AlShevelev/280680b7f8784a45501f63aed13a7e04 to your computer and use it in GitHub Desktop.
This file contains 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
late TiledComponent mapComponent; | |
static const double _minZoom = 0.5; | |
static const double _maxZoom = 2.0; | |
double _startZoom = _minZoom; | |
@override | |
Future<void> onLoad() async { | |
camera.viewfinder | |
..zoom = _startZoom | |
..anchor = Anchor.topLeft; | |
mapComponent = await TiledComponent.load( | |
'map3.tmx', | |
Vector2(64, 73), | |
); | |
world.add(mapComponent); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment