Skip to content

Instantly share code, notes, and snippets.

@AlShevelev
Last active November 25, 2023 15:26
Show Gist options
  • Save AlShevelev/280680b7f8784a45501f63aed13a7e04 to your computer and use it in GitHub Desktop.
Save AlShevelev/280680b7f8784a45501f63aed13a7e04 to your computer and use it in GitHub Desktop.
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