-=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- (c) WidthPadding Industries 1987 0|706|0 -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=-
SoCoder -> Snippet Home -> Generators


 
Jayenkai
Created : 17 December 2020
Edited : 17 December 2020

PHP Spritesheet Shuffler



A PHP script which.

1. Scans a folder for files named "filename_spritewidth_spriteheight_raw.png" or "filename_spritewidth_spriteheight_rawglow.png"

2. If padding is enabled, adds padding to the entire image, and sets the output to the next binary step. (eg 64,128,256,512,1024,2048)
(*I know that has a name, but right now I'm braindead!!)

3. Copies each individual sprite from your original sprite sheet onto the new sheet, leaving padding if required, and stripping out Magenta and Cyan from the output. (255,0,255 & 0,255,255)

4. Saves back out as a plain sprite sheet with transparencies where required, and again with IDs for each sprite on the sheet.

5. If the filename ended with rawglow instead of just raw, then it adds a blurry glow, and saves that version as G_filename.png (Note : This is slow!!)

6. If you've set a DupFolder, it places another copy of the final spritesheet in there, too.



Works fine in PHP7 with GDLib installed. Daren't test with PHP8, it'll probably implode!!

 

Comments