mirror of
				https://github.com/flame-engine/flame.git
				synced 2025-10-31 17:06:50 +08:00 
			
		
		
		
	 cbfa789e75
			
		
	
	cbfa789e75
	
	
	
		
			
			Fix all* typos reported by CSpell, and add some more words into the dictionaries. (Except for two in the flame_isolate/example package).
		
			
				
	
	
		
			24 lines
		
	
	
		
			794 B
		
	
	
	
		
			Dart
		
	
	
	
	
	
			
		
		
	
	
			24 lines
		
	
	
		
			794 B
		
	
	
	
		
			Dart
		
	
	
	
	
	
| import 'package:flame/components.dart';
 | |
| import 'package:flame/game.dart';
 | |
| 
 | |
| class AsepriteExample extends FlameGame {
 | |
|   static const String description = '''
 | |
|     This example shows how to load animations from an Aseprite json file and a
 | |
|     sprite sheet. There is no interaction on this example.
 | |
|   ''';
 | |
| 
 | |
|   @override
 | |
|   Future<void> onLoad() async {
 | |
|     final image = await images.load('animations/chopper.png');
 | |
|     final jsonData = await assets.readJson('images/animations/chopper.json');
 | |
|     final animation = SpriteAnimation.fromAsepriteData(image, jsonData);
 | |
|     final spriteSize = Vector2.all(200);
 | |
|     final animationComponent = SpriteAnimationComponent(
 | |
|       animation: animation,
 | |
|       position: (size - spriteSize) / 2,
 | |
|       size: spriteSize,
 | |
|     );
 | |
|     add(animationComponent);
 | |
|   }
 | |
| }
 |