mirror of
				https://github.com/flame-engine/flame.git
				synced 2025-11-04 13:08:09 +08:00 
			
		
		
		
	
		
			
				
	
	
		
			18 lines
		
	
	
		
			319 B
		
	
	
	
		
			Dart
		
	
	
	
	
	
			
		
		
	
	
			18 lines
		
	
	
		
			319 B
		
	
	
	
		
			Dart
		
	
	
	
	
	
import 'package:flame/components/component.dart';
 | 
						|
 | 
						|
import 'dart:ui';
 | 
						|
 | 
						|
class Square extends PositionComponent {
 | 
						|
  static final _paint = Paint()..color = const Color(0xFFFFFFFF);
 | 
						|
 | 
						|
  Square() {
 | 
						|
    width = 100;
 | 
						|
    height = 100;
 | 
						|
  }
 | 
						|
 | 
						|
  @override
 | 
						|
  void render(Canvas canvas) {
 | 
						|
    canvas.drawRect(toRect(), _paint);
 | 
						|
  }
 | 
						|
}
 |