sanyaade-g2g-repos / grafx2

Automatically exported from code.google.com/p/grafx2
0 stars 0 forks source link

Sprite sheet animation #463

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
I've come up with a fairly simple way of animating any kind of image format, 
based on how sprite sheets were used back in the day. I believe most pixel 
artists are familiar with sprite sheets and why they were laid out as they were.

My idea is a quick view jump function that'd allow you to easily jump between 
desired frames on a sheet. Say you've got a strip of 5 frames in a horizontal 
row, all of a certain size. You'd feed the size of a single frame, the first 
frame's position and how many frames there is. Maybe even milliseconds per 
frame. Some quick keys for traversing and playing the animation with the 
desired rate, and you've got yourself a pretty nice setup for creating nice 
animation sprite sheets.

There's many variants that could be made from this. You could give the 
animation it's own view, while you still have your standard view to edit the 
pixels in. Or you could do it all in the standard view, just jumping the view 
as you swap frames.

A basic version would go a long way I think, since it's easy to set up and 
doesn't really need to be saved with the file. A more advanced version could of 
course be developed from it too, with per frame options and multiple animations 
stored per sheet. It'd be quite a lot messier though, and if such options 
should be implemented they probably need to be saved in a separate file.

In summary
* A dialog for entering frame size, frame count, starting point and frame rate.
* Quick keys for jumping to next and previous frames, as well as a play/pause 
and stop key.
* The dialog could optionally have an export as gif button for the current 
animation selection.

The only addition to the interface would be a single button to bring up the 
dialog. Hope you find the idea interesting and useful.

Original issue reported on code.google.com by zoomula...@gmail.com on 24 Nov 2011 at 3:41

GoogleCodeExporter commented 9 years ago
It's close to how I've been drawing sprite animations for a very long time:
Activate the magnifier, but keep the zoom area small enough, adjust its size so 
that when you press Left or Right cursor, the view is panned exactly to the 
next or previous frame. (it moves by 25% of the visible area, or something)
It's tricky because if you change the zoom level, the sprites become unaligned.

Your idea is interesting because it makes me realize the animation data can be 
interpreted as a simple group of coordinates that refer to the global image: 
for ex "image 1 starts at 16,16, image 2 starts at 32,16, ..."
Such data can be used to quickly navigate to next/previous.

Original comment by yrizoud on 24 Nov 2011 at 5:27

GoogleCodeExporter commented 9 years ago
If you only need to view your sprite-sheet animation there's a script that 
works exactly like that: 
http://code.google.com/p/grafx2/source/browse/trunk/share/grafx2/scripts/samples
_2.4/demo/Spritesheet.lua

But it would be very cool if real spritesheet-animation could be implemented in 
Grafx2 somehow.

Original comment by annas...@hotmail.com on 24 Nov 2011 at 9:49

GoogleCodeExporter commented 9 years ago
I've polished my idea a bit.
The button could toggle a crop on and off, so that you only view the frame and 
not the whole sheet while it's playing. While it's on, you'll see the frame 
number on the button as well. Right clicking on the button would bring up the 
dialog to set up the animation.

@DawnBringer: I tried the script, but it wont actually play anything for me... 
it shows the dialog, but then there's just an hourglass and nothing happens. 
First time trying to run a lua script in grafx2 though, so I might be doing 
something wrong.

Original comment by zoomula...@gmail.com on 25 Nov 2011 at 5:24

GoogleCodeExporter commented 9 years ago
You have to view the swap screen where the anim is played at the center.

Original comment by annas...@hotmail.com on 25 Nov 2011 at 10:23