--Custom themes tutorial for Space Invaders Portable--
Space Invaders Portable from v0.5 and on can have custom themes. 
This is a tutorial to show you how to make custom themes.

Note to other lua coders: You should probably be able to figure everything out and make extensively customized themes, but you should still go through this tutorial to see how the them system works. 

Note: All images must be either PNG or JPG. PNG work best. 

Note: You MAY create new folders for your themes and they will still be selectable from the menu. 

--1. How the theme system works.
The themes each have a ts.tpl, or ThemeSettings.TemPLate which holds the settings for each theme. Depending on how many images of the theme you include, this theme setting file will need to be made to fit. 

--2. Making the ts.tpl to fit your theme

The easiest ts.tpl to make is one for a full theme, a theme with an image for every image used in the game. For a full theme, the ts.tpl will look something like:

bg = Image.load("bg.png")
playerimg = Image.load("player.png")
bulletimg = Image.load("bullet.png")
enemyimg1 = Image.load("e1.png")
enemyimg2 = Image.load("e2.png")
enemyimg3 = Image.load("e3.png")

Note- All variables "bg" "playerimg" "bulletimg" "enemyimg1" "enemyimg2" 

If your corresponding images are named differently, you will need to change the names. Be sure to leave the quotes, and be sure to save as ts.tpl. 

If your theme is not a complete theme, then you need to create empty images for the game to use.

Let's say we have external images for everything except the background. Out ts.tpl should be:

bg = Image.createEmpty(480,272)
bg:clear(white)
playerimg = Image.load("player.png")
bulletimg = Image.load("bullet.png")
enemyimg1 = Image.load("e1.png")
enemyimg2 = Image.load("e2.png")
enemyimg3 = Image.load("e3.png")

Since we do not have an imag for the background, we had to create on. Then bg:clear(white) made it the color white. Colors that already havebeen defined are white, blue, and black. If you wish for the background to be a different color, you'll need to add a line defining the color to the beginning of the level settings file.

nameofcolor = Color.new(r,g,b) 

r, g, and b are the red green and blue factors of the color. 0,255,0 would be green. 255,0,0 would be red. 0,0,255 is blue. Mix them together to create colors. 

If you want to make a theme with images only for the enemies, we'll need to create empty images for everything else. The ts.tpl hould look like this:

bg = Image.createEmpty(480,272)
bg:clear(black)
playerimg = Image.createEmpty(32,16)
playerimg:clear(white)
bulletimg = Image.createEmpty(2,2)
bulletimg:clear(white)
enemyimg1 = Image.load("e1.png")
enemyimg2 = Image.load("e2.png")
enemyimg3 = Image.load("e3.png")

Just make sure to keep the colors different so you can still see everything!

After you've created your images and you ts.tpl, put them in a folder and drop the folder into the "themes" folder. Name the folder how you want it to show up on the thtme selector list, and you're done. 

If you make a custom theme that you would like included with the next release, contact me by email (tacticalpenguin@1337noobs.com) or a PM to the username -TacticalPaper- on Forums.qj.net. 

Thanks for reading!