Treating group of Objects as one Object

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

Moderators: heatherlaine, kevinmiller, robinmiller, malte

Post Reply
Surbhit29
Posts: 80
Joined: Thu Aug 16, 2012 1:25 pm

Treating group of Objects as one Object

Post by Surbhit29 » Mon Aug 27, 2012 2:18 pm

Hello everyone,
I have an object "Oval" which is opaque and in that Oval i have different other objects such as line, rectangle, polygon etc. Now I want is to rotate that Oval such that when it rotates all the objects that are inside that Oval change their position according to the angle of the rotation.
Its like treating all these objects as one object.
Or treating it like an image.
Can this be achieved?

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

Re: Treating group of Objects as one Object

Post by malte » Mon Aug 27, 2012 3:42 pm

Do you want to change the position only? Or do you also want to rotate the objects? If the former, this can be done, the latter is a lot more difficult.

All the best,

malte

Surbhit29
Posts: 80
Joined: Thu Aug 16, 2012 1:25 pm

Re: Treating group of Objects as one Object

Post by Surbhit29 » Mon Aug 27, 2012 6:39 pm

Hi Malte,
Thnx for the reply. I just want to change the position of the objects according to the rotation.

Surbhit

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

Re: Treating group of Objects as one Object

Post by malte » Mon Aug 27, 2012 7:15 pm

rotateGroup.rev.zip
(2.97 KiB) Downloaded 707 times
This one is still rough, but should help to get you started. It rotates a group of graphics around an arbitrary point.

Cheers,

Malte

Surbhit29
Posts: 80
Joined: Thu Aug 16, 2012 1:25 pm

Re: Treating group of Objects as one Object

Post by Surbhit29 » Tue Aug 28, 2012 5:33 am

Thnx for the code Malte.
But when I try to open the code it is showing the error
"Unable to open stack. Stack is corrupted. Check for backup files"

Surbhit

Surbhit29
Posts: 80
Joined: Thu Aug 16, 2012 1:25 pm

Re: Treating group of Objects as one Object

Post by Surbhit29 » Tue Aug 28, 2012 5:42 am

And when I try to open it through livecode, it is showing the error "File is not a stack"

dave_probertGA6e24
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 328
Joined: Mon Dec 05, 2011 5:34 pm
Location: Thailand
Contact:

Re: Treating group of Objects as one Object

Post by dave_probertGA6e24 » Tue Aug 28, 2012 11:22 am

Hi Surbhit -

You do realise the file is Not a livecode file, but a Zip file containing a livecode file. You need to unzip it first. Internet 101!!

Cheers,
Dave
Coding in the Sun - So much Fun.
Visit http://electronic-apps.info for released App information.

Surbhit29
Posts: 80
Joined: Thu Aug 16, 2012 1:25 pm

Re: Treating group of Objects as one Object

Post by Surbhit29 » Tue Aug 28, 2012 11:41 am

I know that already.
And after unzipping it only I have tried to open it in livecode

Klaus
Posts: 13806
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Re: Treating group of Objects as one Object

Post by Klaus » Tue Aug 28, 2012 12:28 pm

Waht versions of LiveCode are you using?

There was a change in fileformat in LiveCode 5.x , so 4.x cannot open these new stacks!
Maybe this is the problem?

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

Re: Treating group of Objects as one Object

Post by malte » Tue Aug 28, 2012 7:20 pm

It is indeed a 5.x stack. I can re upload a legacy version if necessary.

All the best,

Malte

Surbhit29
Posts: 80
Joined: Thu Aug 16, 2012 1:25 pm

Re: Treating group of Objects as one Object

Post by Surbhit29 » Wed Aug 29, 2012 6:34 am

Please upload it.

Post Reply

Return to “Animation Engine”