mirror of
				https://github.com/flame-engine/flame.git
				synced 2025-11-01 01:18:38 +08:00 
			
		
		
		
	 ccee9a466b
			
		
	
	ccee9a466b
	
	
	
		
			
			* 👌 Use `Offset` type directly in `JoystickAction.update` calculations (#631) * Move files to src and comply with the dart package layout convention * Fixing widgets example Co-authored-by: Serge Matveenko <lig@countzero.co> Co-authored-by: Erick Zanardo <erickzanardoo@gmail.com>
		
			
				
	
	
		
			19 lines
		
	
	
		
			362 B
		
	
	
	
		
			Dart
		
	
	
	
	
	
			
		
		
	
	
			19 lines
		
	
	
		
			362 B
		
	
	
	
		
			Dart
		
	
	
	
	
	
| import 'package:flame/components.dart';
 | |
| 
 | |
| import 'dart:ui';
 | |
| 
 | |
| class Square extends PositionComponent {
 | |
|   static final _paint = Paint()..color = const Color(0xFFFFFFFF);
 | |
| 
 | |
|   Square() {
 | |
|     size = Vector2.all(100);
 | |
|     anchor = Anchor.center;
 | |
|   }
 | |
| 
 | |
|   @override
 | |
|   void render(Canvas canvas) {
 | |
|     super.render(canvas);
 | |
|     canvas.drawRect(size.toRect(), _paint);
 | |
|   }
 | |
| }
 |