LoginLogin

Editing the sprite sheet?

Root / Programming Questions / [.]

MZ952Created:
I believe there is a file that you can call upon that changes the sprite sheet the management number calls upon, but i do not know what command does that nor how to change the sprite data. I think i've seen programs use their own custom drawn sprites before. How to?

Don't want to be rude but if you know of examples of games that do it, why didn't you just look at their source code?

No, not rude at all. I have reviewed other's code and, normally, reviewing and tinkering with other's code really helps me learn things. It seems to me that a file is loaded into one of the GRP's (GRP4 seems to be prevalent), and SPDEF is called. I'm just having difficulty finding the connection between it all.

You need to use the Smiletool to go into the sound/sprite area and then click on paint in the upper right. Then you need to click into grp4 from the paint thingy and then edit the spritesheet. Make sure to save! Writing this on a cheap teb dollar phone ead a pain.

Ah, alright thank you! So I create the sprite sheet in the Smiletool, save the file (as a GRP4 im guessing), then I can load the GRP4 file and it will become the 'default' sprite sheet, or the one that is being used? Or must I designate it with SPDEF in some way? EDIT: I'm using the smiletool to edit the sprite sheet, though i notice that some sprites are larger than others. If I were to erase the sprite sheet and start fresh, and since this sprite sheet thing is one giant image, how would the system know where a sprite I create begins and ends?

You need to use 2 things: 1. A image editor(Smiletools is good but I recommend TH. GRP Editor). 2. SPDEF to define sprites that have different proportions or locations than the default sprites. With SPDEF you can define: -The upper left corner where the sprite start (parameters U,V) -The size (Parameters W,H ) -The center of the sprite (Parameters Origin X, Origin Y) -Transformation (Parameter Attribute) The last one is a binary representation of a transformation. You need to put it with the syntax &B[Binary] (Example: &B0001 ) or a number. The position of each "1" will do something to the sprite. For example the code "&B1001" display the sprite and do horizontal inversion to it. That means that if the sprite is facing right on the sheet, then it will face left for the definition number used in SPDEF. You can see more about this function using the "?" icon.

That makes a lot more sense now, thank you! I was really confused about how the system knew where to start and stop when displaying a sprite from the sprite sheet, but you've explained it perfectly.