Animation needs to extend past sprite boundaries

This forum is currently in read-only mode.
From the Asset Store
Carousel Animation, make carousel of you image gallery or anything
  • I have a 64x64 sprite (actually scaling from 302x302) and for a certain animation, the sprite stretches out part of his body to hit an enemy. The frames for this attack animation would be 64x128 because the sprite is actually bigger just during those animations. I tried temporarily making the sprite 64x128, but since my pivot point was in the middle of my sprite, it added the extra width onto both sides (32 pixels on each side rather than 64 pixels in the direction he's facing) and made it look weird. I tried making the canvases on all my animations bigger, but since my pivot point was still where it was when it was just 64x64 rather than in the new center of the image, it wouldn't flip right.

    So basically, I keep failing at this. Is there an easy way to use my 64x128 animation with my normally 64x64 sprite without making it look like the sprite moved or anything, just extended? Imagine a 64x64 box shooting out a 64 pixel width arm and punching an enemy. That is essentially what my sprite is doing.

    Note: The only idea I have left is to use 64x256 (64 in the middle for the regular sprite, then 64 on each side for the attack animation for each direction) images and do the facing left and facing right images for all my animations myself rather than Auto Mirroring.

    Edit: Okay, I tried the above and it insanely raises the VRAM. It went from about 20 MB to almost 75 MB...

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Did you try adjusting with the hotspot?

  • I have a 64x64 sprite (actually scaling from 302x302)

    If you're just going to show the sprite at 64x64 then why is your original image 302x302? That's crazy wasteful. Resize your sprite in Photoshop or something and then import it into Construct.

    I tried temporarily making the sprite 64x128, but since my pivot point was in the middle of my sprite, it added the extra width onto both sides (32 pixels on each side rather than 64 pixels in the direction he's facing) and made it look weird.

    You need to change your hotspots. They don't have to be in the center. If you have a sprite of a boxer, and the hotspot is on his shorts, then to make him stay "still" across all frames you need to put the hotspot on his shorts. When he throws a punch his sprite might be getting wider, but you still need to place the hotspot where it belongs instead of the center.

  • Ah, I understand now. I misunderstood how Hotspots worked. Thanks for clearing that up.

    As for the 302x302 sprite. When I resized him in Photoshop his sprite had less detail then having Construct scale it (don't know how that happened), so for early development I kept it at original resolution, but I know what you mean. I'll resize it. VRAM builds up quick...

    Edit: Wait...no, I didn't misunderstand before. My Hotspot needs to be in the center for Auto Mirror to look right, but needs to be at X=0 when I resize, so I think I need to temporarily switch hotspots just during the resize so all the extra width goes on the right side of the sprite rather than being split on each side (when it is split on each side, it looks like you moved all of a sudden). I'll work on this more tomorrow. Being tired=terrible game development.

  • I solved it! I thought I would have to tell the sprite to change size for the animation, otherwise it would squish the 128x64 frames into the 64x64 sprite size. Nope. Construct does all the work of extending the sprite itself! It is amazing how much Construct does for you...

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)