Scaling/animating shapes?

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help, read this.
Post Reply
Gnx
Prole
Posts: 40
Joined: Sun Nov 09, 2008 6:38 am

Scaling/animating shapes?

Post by Gnx »

It didn't instantly nor after some docs reading occur to me whether you can actually scale/transform shapes on the fly.
For somehow after playing around a while with Löve my mind told me "Look Gnx you need to make monster, monster that when you shoot only executes more setMass() functions and its shape scales up in size!".

So perhaps this can be done, or would be something to be included in future versions?
User avatar
rude
Administrator
Posts: 1052
Joined: Mon Feb 04, 2008 3:58 pm
Location: Oslo, Norway

Re: Scaling/animating shapes?

Post by rude »

I'm afraid you can't scale shapes after they have been created. This is a Box2D limitation, and I don't think the author has any plans of including this either.

You can attatch and remove shapes on the fly, of course, but "smooth" scaling of shapes is not feasible.
Gnx
Prole
Posts: 40
Joined: Sun Nov 09, 2008 6:38 am

Re: Scaling/animating shapes?

Post by Gnx »

Meh :x

Though I guess the overhead wouldn't be terrible if I for looped shape destroys and attachs by unit?
User avatar
rude
Administrator
Posts: 1052
Joined: Mon Feb 04, 2008 3:58 pm
Location: Oslo, Norway

Re: Scaling/animating shapes?

Post by rude »

What? That sentence did not compute.
Gnx
Prole
Posts: 40
Joined: Sun Nov 09, 2008 6:38 am

Re: Scaling/animating shapes?

Post by Gnx »

Speed thinking results in bad expression ;)

Anyway I was thinking of hacking this by repeatedly destroying the shape attached to the body and attaching a new incrementally larger shape to the body (until reaching the desired size).
User avatar
rude
Administrator
Posts: 1052
Joined: Mon Feb 04, 2008 3:58 pm
Location: Oslo, Norway

Re: Scaling/animating shapes?

Post by rude »

That could work, but would mean some overhead. Whether or not that is exceptable depends on the number of enemies on which you must do this.
User avatar
MHD
Prole
Posts: 18
Joined: Fri Nov 14, 2008 11:45 pm
Location: Denmark

Re: Scaling/animating shapes?

Post by MHD »

Gnx wrote:Speed thinking results in bad expression ;)

Anyway I was thinking of hacking this by repeatedly destroying the shape attached to the body and attaching a new incrementally larger shape to the body (until reaching the desired size).
Yeah, that was what I was thinking too.
I r awsum at looah ^^
Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot] and 5 guests