constrainRectangular

Create fast, sprite powered games with Animation Engine, co-developed with DerBrill Software!

Moderators: heatherlaine, kevinmiller, robinmiller, malte

Post Reply
Bjoern
Posts: 7
Joined: Mon Nov 07, 2011 9:41 pm

constrainRectangular

Post by Bjoern » Sat Nov 26, 2011 2:45 pm

Hi Malte,

first of all thx for the awesome AE! It is really fun!

However atm I am stuck with one problem.

I created an image and set "constrainRectangular" so it is dragable.
To drag and click on it I use:
on constrainRectangularInit
on constrainRectangularCallBack
on constrainRectangularExit

So far no problem. I can drag it to places and click on it.

Now to the problem.
Once I dragged it to a defined spot I want to disallow the draggeing but still want to be able to click on it.

I tried set constrainRectangular to empty --> no dragging but also no clicking possible
I tried set opaque to false --> not effect
I tried set Locklocation--> no effect
I also tried to jump from "constrainRectangularCallBack" to "constrainRectangularExit" with messages...

At the moement I am quite lost.

I hope you can help.

Cheers, Björn

malte
Posts: 1098
Joined: Thu Feb 23, 2006 8:34 pm
Location: Ostenfeld germany
Contact:

Re: constrainRectangular

Post by malte » Sun Nov 27, 2011 11:05 am

Hi Björn,

as soon as the constrainRectangular is set to empt the callback messages are no longer sent. :-) as soo as you do not want to drag the object anymore, make sure to set the constrainRectangular to empty and handle mouseDown / up instead...

on mouseUp
if the constrainRectangular of me is empty then
-- do stuff for non moving state
else
-- needs to pass, Gandalf!
pass mouseUp
end if
end mouseUp

Hope this helps,

Malte

Post Reply

Return to “Animation Engine”