mirror of
				https://github.com/flame-engine/flame.git
				synced 2025-11-04 04:47:13 +08:00 
			
		
		
		
	
		
			
				
	
	
		
			25 lines
		
	
	
		
			654 B
		
	
	
	
		
			Dart
		
	
	
	
	
	
			
		
		
	
	
			25 lines
		
	
	
		
			654 B
		
	
	
	
		
			Dart
		
	
	
	
	
	
import 'dart:ui';
 | 
						|
 | 
						|
import 'package:flutter/foundation.dart';
 | 
						|
 | 
						|
import '../extensions/vector2.dart';
 | 
						|
import '../nine_tile_box.dart';
 | 
						|
import 'position_component.dart';
 | 
						|
 | 
						|
/// This class is a thin wrapper on top of [NineTileBox] as a component.
 | 
						|
class NineTileBoxComponent extends PositionComponent {
 | 
						|
  NineTileBox nineTileBox;
 | 
						|
 | 
						|
  /// Takes the [NineTileBox] instance used to render this box.
 | 
						|
  ///
 | 
						|
  /// It uses the x, y, width and height coordinates from the [PositionComponent] to render.
 | 
						|
  NineTileBoxComponent(this.nineTileBox);
 | 
						|
 | 
						|
  @mustCallSuper
 | 
						|
  @override
 | 
						|
  void render(Canvas c) {
 | 
						|
    super.render(c);
 | 
						|
    nineTileBox.drawRect(c, size.toRect());
 | 
						|
  }
 | 
						|
}
 |