I feel like this was discussed in a tutorial once, but I forget where. I just created a reaching animation for my main character. I had to expand the canvas size of the bmp in order to draw the outstretched arm. I loaded the sprites into the manager and created a view. It works fine when the animation runs on the normal side, but when I flip the view for the right side, the character shifts over to the right in a big jerky way when she picks something up from that side.
Is there any way I can make this look right without having to go through every view and sprite and load an expanded canvas for each one?
These views are all cropped by the way.
There are 2 easy solutions:
1. AGS 2.7 can align frames: Character[].LockViewAligned
2. Let's suppose you added 15 pixels to the right to draw the outstretched arm. Just add 15 to the left as well. The character sprites' hotspot is always at the bottom-center.
Strange though that your non-flipped animation didn't also shift.
Anyways, here's part of an old char of mine, and it works fine:
(http://home.pages.at/choala/ags/jimmy.png)
I used the Character[].LockViewAligned, it helps a bit---though there is still a little bit of a shift going on. I'm not sure what you mean about adding pixels. Are you talking about adding pixels to the original bmp? Does that really help when all of the sprites are already cropped?
Yes, that's the recommended way to do it.
Since by default sprites are centered on the character, make sure you add equal space to both sides of the sprite.
See Khrismuc's example: He wants the character to stretch out his arm, so he adds some pixels to the right side of the sprite where the arm will be, but he also adds the equal amount of pixels to the left side.
Ah, got it. I expanded the pixels evenly just on the arm reach frame, and then used the Align script. I still saw a tiny bit of difference in the frames, but I after an hour of screwing with it I just realized it was the character scaling that was causing the difference.
Thanks!
QuoteI expanded the pixels evenly just on the arm reach frame, and then used the Align script.
If you expanded both sides of the sprites you don't need to align the animation. It's centered by default so a simple SetCharacterView/LockView should suffice.
You only need to align the view if you DON'T expand the sprites.
It's easier the first way because if you need to align the view, you would have to check which way he's facing and align the view accordingly.
If you simply expand the sprites, you don't need to align the view at all.