Sprite Editor
View File
This runs on the latest emulator only and will not run on the "Web Emulator." As such, there is no "Try it now" button. You need to download the emulator if you don't have it. When the emulator is updated in the future, I will update this program as well. Currently, the latest emulator is version R41.
Preliminary version of my Sprite Editor. It has the minimum basic features needed to create sprite files and edit their sprite and palette data. Sprites are stored in a binary file with the extension .SPR that contains a header 6 bytes long as follows:
Byte 1 and 2: set to 0. Byte 3: Bits Per Pixel, Can be 4 or 8. Byte 4: Width, can be 8, 16, 32, or 64. Byte 5: Height, can be 8, 16, 32, or 64. Byte 6: Frames, Can be 1 to 6.
In this release, ONLY 4 bpp, 32 pixel width, 32 pixel height are supported. Those values can be set otherwise, but will have no effect.
After the header, The palette is in the next 32 bytes. It is 2 bytes per entry stored in the same format as the VERA stores it's palette entries. The sprites themselves follow the palette in sequential order.
The file is loaded into a 16K buffer in VERA ram. In future releases, the maximum number of frames for an individual sprite strip will by determined by how many sprites of the specified size will fit into that buffer. All sprites in the file share the same palette, and are intended to be "animation frames" for a single on screen sprite.
Controls:
The Sprite Editor is mostly controlled by the mouse, there are currently no key press controls except when the file name field when it is in edit mode. (See "file name field" below.)
Controls are visually cued in that they are white text with a light grey background. Hovering the mouse over a control cause the text to turn yellow, clicking on the control activates it's function. All of the controls are asynchronous, meaning that the application's main event dispatch loop does not stop when a control is in use.
On the left side, the topmost control is the FILE NAME field. Clicking it puts it in edit mode and shows a flashing cursor. Typing text into the field inserts text at the cursor, there currently is no "overwrite" mode. The usable control keys are DELETE, which deletes the character at the cursor and moves the ones after it to the left, BACKSPACE, which deletes the character at the cursor and then moves the cursor one space to the left, LEFT ARROW and RIGHT ARROW, which moves the cursor left and right, and ENTER, which turns off edit mode and makes the new file name usable by the LOAD and SAVE buttons. Pressing LOAD or SAVE while the editor is still on will use the original file name.
Note, all of the controls that are buttons use both the left and right mouse button. The left button increases the value, the right button decreases the value as appropriate.
LOAD Loads the sprite strip indicated by the file name.
SAVE Saves the current sprite strip to the file specified.
BPP Sets the Bits Per Pixel of the sprites in the strip. Legal values are 4 and 8. Currently, only 4 is used.
WIDTH Sets the width of the sprites in the strip. Legal values are 8, 16, 32, or 64. Currently, only 32 is used.
HEIGHT Sets the height of the sprites in the strip. Legal values are 8, 16, 32, or 64. Currently, only 32 is used.
FRAMES Sets the number of frames in the strip. Currently, the values 1 to 6 are legal and will be used. A future version will increase that.
RESET Currently does nothing. A future version will use this button to reset the sprite strip and sprite editor after changes to the BPP, WIDTH, and HEIGHT are made.
To the right of the above buttons is the Sprite Strip. Hovering the mouse over it will cause a yellow box to show around it. Clicking on an active sprite in the strip will transfer that sprite to the Sprite Editor control.
On the bottom right, to the left of the palette display:
P This sets the Palette Page. The VERA palette has 256 entries, and is divided into 16 16 entry pages. By default, the editor uses Palette Page 'F' (15 in decimal.) to hold the 16 entry palette for the current sprite strip. Pressing the left or right mouse button will cycle the pages through all available pages.
The Palette Display is also a control. Hovering the mouse over it will cause a yellow box to display around it. Left clicking on a palette entry will transfer that color's RGB entries to the RGB controls above the Palette Display, and will also transfer the color itself into the Foreground Color box to the left of the RGB controls. Right clicking on a palette entry will transfer that color to the Background Color to the far right.
RGB Controls the values directly above the buttons the edit the RGB components of the selected palette entry. The range of an individual entry is 0 to 15 (0 to F on the display, which is in hexadecimal.)
In the upper right is the Sprite Editor control itself. When the mouse is over it, the X,Y coordinates of the mouse in the sprite are displayed. On left click, the Foreground color if set into that pixel, on right click, the Background Color is set into the pixel. The Sprite Strip will update in real time as the colors are edited.
Submitter
Submitted
12/10/22
Category