mirror of
				https://github.com/flame-engine/flame.git
				synced 2025-10-31 00:48:47 +08:00 
			
		
		
		
	 a5338d0c20
			
		
	
	a5338d0c20
	
	
	
		
			
			Adds a `Paint` attribute to the `SpriteWidget` and `SpriteAnimationWidget` for an improved API. --------- Co-authored-by: Lukas Klingsbo <me@lukas.fyi>
		
			
				
	
	
		
			29 lines
		
	
	
		
			531 B
		
	
	
	
		
			Dart
		
	
	
	
	
	
			
		
		
	
	
			29 lines
		
	
	
		
			531 B
		
	
	
	
		
			Dart
		
	
	
	
	
	
| import 'dart:ui';
 | |
| 
 | |
| final paintChoices = [
 | |
|   'none',
 | |
|   'transparent',
 | |
|   'red tinted',
 | |
|   'green tinted',
 | |
|   'blue tinted',
 | |
| ];
 | |
| final paintList = [
 | |
|   null,
 | |
|   Paint()..color = const Color(0x22FFFFFF),
 | |
|   Paint()
 | |
|     ..colorFilter = const ColorFilter.mode(
 | |
|       Color(0x88FF0000),
 | |
|       BlendMode.srcATop,
 | |
|     ),
 | |
|   Paint()
 | |
|     ..colorFilter = const ColorFilter.mode(
 | |
|       Color(0x8800FF00),
 | |
|       BlendMode.srcATop,
 | |
|     ),
 | |
|   Paint()
 | |
|     ..colorFilter = const ColorFilter.mode(
 | |
|       Color(0x880000FF),
 | |
|       BlendMode.srcATop,
 | |
|     ),
 | |
| ];
 |