| Create your own sprite resource files |
Actor Editor - David Brebner (c) Unlimited Realities 97
I have no responsibility for anything you might do with this software. But feel free to do what you want. This began as part of URGAT (Unlimitied Realities Graphical Authoring Tool). Due to lots of questions, and seeing I used it in my tutorials I figured I really ought to make it public. I had described it as a sprite editor - this is not really correct. It's actually an actor editor. I don't want to begin to develop graphical editor (well I do, but too many projects). Whats it Do? I use the Actor Editor for all sorts of projects. It is a tool for selecting and registering variable sized and positioned characters or cells from a bitmap. To create the bmp or gif initially you can use paint shop, Photoshop, Fractal Design Painter, Photoimpact, 3DSMax... whatever you prefer. I often use images I scan or capture from video. Explanation For each cell in our actors sprite file (each picture) we need 6 numbers to descibe it.
'hold the sprites
Private spnx%(15), spny%(15), spnw%(15)
Private spnh%(15), spnox%(15), spnoy%(15)
'load up the sprites
Open App.Path & "\whack_img.spr" For Random As #1 Len = 2
For a% = 0 To 14
Get #1, a% * 6 + 1, spnox%(a% + 1)
Get #1, a% * 6 + 2, spnoy%(a% + 1)
Get #1, a% * 6 + 3, spnx%(a% + 1)
Get #1, a% * 6 + 4, spny%(a% + 1)
Get #1, a% * 6 + 5, spnw%(a% + 1)
Get #1, a% * 6 + 6, spnh%(a% + 1)
Next
Close #1
This system overcomes the tedious job of designing sprites on a grid. This was a traditional method known as tile sets. The idea was that a give cell was square in shape and it's position in the source image can be calculated by multiplying the width and height of the squares by the column and row. There are two big disadvantages the Actor Editor overcomes. First you can use sprites of any size, second you can register your sprites easily. In a graphics program you cannot usually flip between cells. With the actor-editor just press the up and down keys to flip between cells, making sure the animation is smooth. Instructions First you choose a BMP or GIF you want to use as a source bitmap. The actor_editor wall automatically load an SPR file if one exists or create one if it does not. Changes are save when you change image files. Infact To save you must change files rather than exiting by closing the application.
I have provided keyboard and mouse shortcuts for manipulating the 6 magin numbers. You can adjust the current cell (row in the grid, picture..)
Testing an animation You can test an animation by typing in the test sequenct text box at the bottom left. The sequence of frames should be seperated and followed by a comma. When you press the test button the animation button will loop until you press it again. Registering against a Background I often use a main image, which I then animate sections of. You can see the cat on the clipboard example in the screen shots I have included. The main graphic, and first cell is a cat sitting on a clipboard. The following cells are the cat looking around and moving its tail. To make it easy to line the tail or eye animations up with the first cell I have added the Use as Bkg button. This will take the cell number you enter and use it as a background behind the current cell. Just press it again to remove the background. Hope you all enjoy the Actor Editor. Remember to look at the wackarat tutorial to find out how to load and use SPR files in your programs.
David Brebner |