mirror of
				https://github.com/flame-engine/flame.git
				synced 2025-10-30 16:36:57 +08:00 
			
		
		
		
	feat: Add isDragged in DragCallbacks mixin (#2472)
				
					
				
			Adding a isDragged state for DragCallbacks mixin. This was available in the Draggable mixin.
This commit is contained in:
		| @ -90,7 +90,6 @@ abstract class MyCollidable extends PositionComponent | ||||
|   late final Paint _dragIndicatorPaint; | ||||
|   final ScreenHitbox screenHitbox; | ||||
|   ShapeHitbox? hitbox; | ||||
|   bool isDragged = false; | ||||
|  | ||||
|   MyCollidable( | ||||
|     Vector2 position, | ||||
| @ -154,14 +153,9 @@ abstract class MyCollidable extends PositionComponent | ||||
|   } | ||||
|  | ||||
|   @override | ||||
|   void onDragStart(DragStartEvent info) { | ||||
|     isDragged = true; | ||||
|   } | ||||
|  | ||||
|   @override | ||||
|   void onDragEnd(DragEndEvent info) { | ||||
|     velocity.setFrom(info.velocity / 10); | ||||
|     isDragged = false; | ||||
|   void onDragEnd(DragEndEvent event) { | ||||
|     super.onDragEnd(event); | ||||
|     velocity.setFrom(event.velocity / 10); | ||||
|   } | ||||
| } | ||||
|  | ||||
|  | ||||
		Reference in New Issue
	
	Block a user
	 DevKage
					DevKage