ConstrainRectangular error

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

Moderators: heatherlaine, kevinmiller, robinmiller, malte

Post Reply
JosepM
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 344
Joined: Tue Jul 20, 2010 12:40 pm

ConstrainRectangular error

Post by JosepM » Tue May 08, 2012 12:53 pm

Hi,

I have a problem with constrainRectangular.

I have a group with many buttons and graphics inside. I set the constrainRectangular to the rect of the group.
I put the "grab me" with the mousedown of each control with the "mousedown pass", so the controls don't must go outside the group, but if I grab any and while the mousedown is active the control go outside the group. It's like the control stop at first step with the border of the group but if I move far away the group finally the control go out.

Any idea? I'm missing something?

Salut,
Josep M

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

Re: ConstrainRectangular error

Post by malte » Tue May 08, 2012 9:38 pm

Hi Josep,

you indeed are missing something. :-)

There is no need to use grab at all with the constrainRectangular of a control set. Instead, make sure the control can receive all mouseMessages (mouseDown / mouseUp / mouseMove)

Hope that helps,

Malte

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

Re: ConstrainRectangular error

Post by malte » Tue May 08, 2012 9:38 pm

Also make sure that the groups lockLoc is set to true...

JosepM
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 344
Joined: Tue Jul 20, 2010 12:40 pm

Re: ConstrainRectangular error

Post by JosepM » Thu May 10, 2012 4:54 pm

Hi Malte,

Yes, the problem was with the "grab me"...

But that I try seems don't work or maybe it's not possible.
I try to set the constrain of a group to another group. The group B have a chess board as image and the pieces with the constrain set to the board. This work fine.
But then I want set the constrain of this group B to a another group A. The group A is like a visor, the user don't see the whole chess board so he must move it through the group A.

When I click over the pieces, they move correctly but when click over the chess board to move it, nothing happen....

It's posible?

The code:

Code: Select all

on mouseUp
   set the constrainRectangular of button "c1" to the rect of group "board"
   set the constrainRectangular of button "c2" to the rect of group "board"
   
   set the constrainRectangular of group "board" to the rect of group "viewer"
end mouseUp
That I want is that moving the board also move the pieces without recalculate the positions...

Salut,
Josep M

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

Re: ConstrainRectangular error

Post by malte » Thu May 10, 2012 8:45 pm

Goups are a little trickier to handle...

I am currently in hospital, so I can not whip up something quickly. I shall be back in office next week and see if I can post an example script.

Cheers,

Malte

JosepM
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 344
Joined: Tue Jul 20, 2010 12:40 pm

Re: ConstrainRectangular error

Post by JosepM » Thu May 10, 2012 10:38 pm

Hi Malte,

Thanks for answer. Don't worry.

Keep well.
Josep M

JosepM
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 344
Joined: Tue Jul 20, 2010 12:40 pm

Re: ConstrainRectangular error

Post by JosepM » Fri Jun 01, 2012 9:29 am

Hi Malte,

Can you able to think how to solve the issue of groups?

Salut,
Josep M

Post Reply

Return to “Animation Engine”