The Daily Click ::. Forums ::. Klik Coding Help ::. Move multiple objects to the grid
 

Post Reply  Post Oekaki 
 

Posted By Message

vetmora120



Registered
  07/01/2010
Points
  273
19th November, 2013 at 19/11/2013 22:22:09 -

Hi Guys,

Having trouble with moving multiple objects with the grid using a drag and drop with the mouse method. I know to move an object relative with the mouse is XMouse/GridWidth*GridWidth and YMouse/GridHeight*GridHeight. However if I do this to all the objects within the same "group" they will all get put in the same position so they're all overlapping. I'd like the objects to move relative to where they were if possible.

What is the method to do this?

Cheers

 
n/a

UrbanMonk

BRING BACK MITCH

Registered
  07/07/2008
Points
  49566

Has Donated, Thank You!Little Pirate!ARGH SignKliktober Special Award TagPicture Me This Round 33 Winner!The Outlaw!VIP MemberHasslevania 2!I am an April FoolKitty
Picture Me This Round 32 Winner!Picture Me This Round 42 Winner!Picture Me This Round 44 Winner!Picture Me This Round 53 Winner!
20th November, 2013 at 20/11/2013 07:01:57 -

Sometimes object selection is wacky because MMF has no way of knowing what you're trying to accomplish.
I assume you're just applying the formula to the group by referencing the groups X and Y position in the formula itself correct? I think this issues lies in the fact that it's referencing not only different instances of the same object, but also separate objects altogether. If that makes any sense to you.

Try storing the X and Y positions of all the objects in the group into their respective alterable variables and then apply the formula again but use the variables instead of referencing the objects position directly.

This should work. If it doesn't then try instead to store the positions of all the objects in the group individually into their alterable values before applying the formula to the group.

It's an odd workaround, but it should work.

 
n/a

vetmora120



Registered
  07/01/2010
Points
  273
20th November, 2013 at 20/11/2013 09:36:20 -

Either it's not working or I'm not following correctly.

I tried storing all the objects X and Y within said group into Alterable Value's A and B, respectively. Then Setting their X with the formula and using the Alterable Values. This doesn't work because I need to include the mouse's position somewhere.

 
n/a

UrbanMonk

BRING BACK MITCH

Registered
  07/07/2008
Points
  49566

Has Donated, Thank You!Little Pirate!ARGH SignKliktober Special Award TagPicture Me This Round 33 Winner!The Outlaw!VIP MemberHasslevania 2!I am an April FoolKitty
Picture Me This Round 32 Winner!Picture Me This Round 42 Winner!Picture Me This Round 44 Winner!Picture Me This Round 53 Winner!
20th November, 2013 at 20/11/2013 16:44:08 -

Wait. Maybe I'm confused at what you're trying to do.
What is the criteria for locking an object to the mouse? Does it need to be selected?

Can you upload your MFA somewhere so I can see what you're trying to accomplish?

 
n/a

vetmora120



Registered
  07/01/2010
Points
  273
20th November, 2013 at 20/11/2013 21:54:25 -

Fixed it!

Image

Edited by vetmora120

 
n/a

UrbanMonk

BRING BACK MITCH

Registered
  07/07/2008
Points
  49566

Has Donated, Thank You!Little Pirate!ARGH SignKliktober Special Award TagPicture Me This Round 33 Winner!The Outlaw!VIP MemberHasslevania 2!I am an April FoolKitty
Picture Me This Round 32 Winner!Picture Me This Round 42 Winner!Picture Me This Round 44 Winner!Picture Me This Round 53 Winner!
24th November, 2013 at 24/11/2013 05:41:02 -

Great! Sorry I couldn't get around to messing with your mfa.

 
n/a
   

Post Reply



 



Advertisement

Worth A Click