Draggable Objects (Transparancy)


#1

Hello!

I have some draggable sprite objects. They are PNGs with transparent areas. I want the draggable behavior to ignore the transparant areas, ie, only drag the visible parts of the object.

Does anyone know how to do it?

Thanks in advance!


#2

You cannot. Draggable, just like the “Mouse is on” event conditions, only cares about the actual object boundaries.

They do not see/care about transparency or collision masks.


#3

Are there any workarounds?


#4

You can use a placeholder sprite smaller than the others add the draggable behavior to that placeholder then set the position of the others spites to the placeholder if this is dragging, maybe use Link or add an object variable to check if this sprite.Variable(number) == placeholder.variable(number) then set this sprite position to placeholder.


#5

This is a good idea, I might just do that. Thank you!


#6

n/m, I didn’t read the question thoroughly enough.