I set drag behavior on red sprite to vertical only
How do i make when i drag up the red sprite it will stop drag when the red sprite.bboxbottom overlap with blackbox.bbbotom
And when i drag down the redsprite will stop when it bboxtop = to blackbox.bboxtop
I just want it can scroll in the blackbox only
I found capx example they always make the limit to layout height but i dont want that. Pls help
If RedSprite has image point in the middle, you can do this:
RedSprite set y to min(self.y, BlackBox.BboxBottom-RedSprite.height/2)
You can put this action into "Is dragging" and "On drop" events, or do this on every tick.
Develop games in your browser. Powerful, performant & highly capable.
Tried that not work.
dropbox.com/s/34sp6baked9gfv9/Redandblack.c3p
It does work, but the origin image point in Red sprite is not in the center.
I also suggest adding "On drop" event with the same action.