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

Treating group of Objects as one Object

Postby 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?
Surbhit29
 
Posts: 80
Joined: Thu Aug 16, 2012 1:25 pm

Re: Treating group of Objects as one Object

Postby 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
malte
 
Posts: 1096
Joined: Thu Feb 23, 2006 8:34 pm
Location: Ostenfeld germany

Re: Treating group of Objects as one Object

Postby 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
Surbhit29
 
Posts: 80
Joined: Thu Aug 16, 2012 1:25 pm

Re: Treating group of Objects as one Object

Postby malte » Mon Aug 27, 2012 7:15 pm

rotateGroup.rev.zip
(2.97 KiB) Downloaded 281 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
malte
 
Posts: 1096
Joined: Thu Feb 23, 2006 8:34 pm
Location: Ostenfeld germany

Re: Treating group of Objects as one Object

Postby 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

Postby 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"
Surbhit29
 
Posts: 80
Joined: Thu Aug 16, 2012 1:25 pm

Re: Treating group of Objects as one Object

Postby 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.
dave_probertGA6e24
Livecode Opensource Backer
Livecode Opensource Backer
 
Posts: 328
Joined: Mon Dec 05, 2011 5:34 pm
Location: Thailand

Re: Treating group of Objects as one Object

Postby 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
Surbhit29
 
Posts: 80
Joined: Thu Aug 16, 2012 1:25 pm

Re: Treating group of Objects as one Object

Postby 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?
Klaus
 
Posts: 9498
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany

Re: Treating group of Objects as one Object

Postby 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
malte
 
Posts: 1096
Joined: Thu Feb 23, 2006 8:34 pm
Location: Ostenfeld germany

Re: Treating group of Objects as one Object

Postby Surbhit29 » Wed Aug 29, 2012 6:34 am

Please upload it.
Surbhit29
 
Posts: 80
Joined: Thu Aug 16, 2012 1:25 pm


Return to Animation Engine

Who is online

Users browsing this forum: No registered users and 2 guests