As the title suggests, i would like to eliminate an Actor from the Stage when the player moves it outside my SourceTarget. The default behavior of DragAndDrop class doesn't allow to drag an Actor on a place that isn't a valid SourceTarget, but i need to implement the elimination of an Actor in this way.

So, can i implement one or both the following solutions?

1) When the Actor is dragged outside SourceTarget, remove it

2) Use a special TargetActor over which the dragged Actor gets removed (like a trash can)

In this latter case i should create a second special TargetActor, but seems that Libgdx doesn't allow it. I can have only one TargetActor. In my particular case SourceActor and TargetActor are the same.

dragAndDrop.addSource(new SourceActor(slotActor));
dragAndDrop.addTarget(new TargetActor(slotActor));

Thank you


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.