mirror of
				https://github.com/flame-engine/flame.git
				synced 2025-11-01 01:18:38 +08:00 
			
		
		
		
	 23a72f5f39
			
		
	
	23a72f5f39
	
	
	
		
			
			* No setter for position and size * Use setter for position and size * Add onPositionUpdate and snapTo to Camera * Fix formatting * Fix size in test * Update packages/flame/CHANGELOG.md Co-authored-by: Jochum van der Ploeg <jochum@vdploeg.net> * Update packages/flame/CHANGELOG.md Co-authored-by: Jochum van der Ploeg <jochum@vdploeg.net> * Better naming for internal position state * Anchor and angle defaults on effect test utils * No setter for position and size * Fix scale effect * Fix formatting Co-authored-by: Jochum van der Ploeg <jochum@vdploeg.net> Co-authored-by: Erick Zanardo <erickzanardoo@gmail.com>
		
			
				
	
	
		
			17 lines
		
	
	
		
			351 B
		
	
	
	
		
			Dart
		
	
	
	
	
	
			
		
		
	
	
			17 lines
		
	
	
		
			351 B
		
	
	
	
		
			Dart
		
	
	
	
	
	
| import 'dart:ui';
 | |
| 
 | |
| import 'package:flame/components.dart';
 | |
| import 'package:flame/palette.dart';
 | |
| 
 | |
| class SquareComponent extends PositionComponent {
 | |
|   Paint paint = BasicPalette.white.paint();
 | |
| 
 | |
|   SquareComponent() : super(size: Vector2.all(100.0));
 | |
| 
 | |
|   @override
 | |
|   void render(Canvas c) {
 | |
|     super.render(c);
 | |
|     c.drawRect(size.toRect(), paint);
 | |
|   }
 | |
| }
 |