I have an object Rectangle and it is draggable. The object is inside a circle. How can I restrict the path of the rectangle inside the circle, i.e the rectangle cannot be drag outside but within the circle.
Please tell me the code..
Object drag inside a circle
Moderators: heatherlaine, kevinmiller, robinmiller, malte
Re: Object drag inside a circle
For a rectangle this is a little tricky. what you can do is constrain it in a way that can check if the location of your object (the middle point) is still within the circle. Would that help?
Re: Object drag inside a circle
I already tried that, but it didn't help. What if I use a rounded rectangle such that it matches the circumference of the circle. Can you help now..?
Also I am new at it. It will be great if you can post code for it.
Also I am new at it. It will be great if you can post code for it.
Re: Object drag inside a circle
Also can it help if I use collision detection.. And then prevent the collision to occur
Re: Object drag inside a circle
Well, if you say you did that, it would be helpful if you told us what you tried.
Re: Object drag inside a circle
Actually I just followed the steps that came in Animation Engine 5 tutorial padf...
Created 6 graphics, a label field and a button.... Now the first object that was created when collide with any of the five objects the label field shows the detection.....
Created 6 graphics, a label field and a button.... Now the first object that was created when collide with any of the five objects the label field shows the detection.....