How do I add an animation to a sprite in game

Get help using Construct 2

Post » Thu Mar 16, 2017 2:13 pm

is there any way to add a new animation to a sprite during the game, and then add some frames to it also in game?
B
25
S
16
G
26
Posts: 125
Reputation: 16,103

Post » Thu Mar 16, 2017 2:34 pm

Add a new animation, no.
But loading frames on the fly can be done by using the Sprite's action "Load from URL".
Nevertheless, the animation and frames must already be there.
New to Construct ? Where to start

Image Image

Image Image

Please attach a capx to any help request or bug report !
Moderator
B
296
S
119
G
96
Posts: 7,332
Reputation: 71,306

Post » Thu Mar 16, 2017 3:45 pm

You could just make a bunch of empty Frames in an Animation on your Sprite and define them later.
When you just begin learning this Stuff, don't make big things. Start Small.
B
9
S
2
G
1
Posts: 29
Reputation: 1,077

Post » Thu Mar 16, 2017 5:30 pm

Another way to handle that is to replace the sprite with a different sprite.

You can destroy the old sprite after you position the new sprite to it's position.

That is useful if you have a player character that turns into a car or something like that.
Banned User
B
28
S
7
G
58
Posts: 1,229
Reputation: 34,830

Post » Thu Mar 16, 2017 9:29 pm

'You could just make a bunch of empty Frames in an Animation on your Sprite and define them later.'

Is there anyway to rename animations in the game?



maybe i could make a bunch of empty animations then allow the user to assign a dictionary key with the sprite.animationname...


idk thanks for your responses.
B
25
S
16
G
26
Posts: 125
Reputation: 16,103

Post » Thu Mar 16, 2017 9:56 pm

ok, that seems to work.

thanks all
B
25
S
16
G
26
Posts: 125
Reputation: 16,103

Post » Fri Mar 17, 2017 2:32 pm

@celstrider I don't think you can rename animations or Frames ingame, but you could just set a bunch of them to some name and remember the name of it. If you could rename Animations I would actually be suspicious why you couldn't add animations xD
When you just begin learning this Stuff, don't make big things. Start Small.
B
9
S
2
G
1
Posts: 29
Reputation: 1,077


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 26 guests