Battlefield is the screen players will see all the time. At first I thought about building it from tiles, but I changed my mind. It’s going to be fullscreen graphics, in all it’s HD glory. I found some free wood, sand and stone textures and played with them in Gimp for almost two days now. Here’s the end result:
Looks kind of lame on this thumbnail size, but I assure you it’s much better on an Android device. The shaded part is the background used to fill the space on wider devices. It isn’t really shaded in the actual file.
I created this screen at 2134×2733 pixels, so that it covers all possible Android devices. Now, I need to scale it to sizes appropriate for 800, 1024, 1280, 1536 and 1920 screens. To avoid doing this manually, I created a simple script that calls the imagemagick tool to do the scaling. Here’s the script:
convert images/2560/$1 -resize 31.25% images/800/$1
convert images/2560/$1 -resize 37.5% -gravity center -crop 1024x1024+0+0 +repage images/1024/$1
convert images/2560/$1 -resize 50% images/1280/$1
convert images/2560/$1 -resize 60% images/1536/$1
convert images/2560/$1 -resize 75% -gravity center -crop 2048x2048+0+0 +repage images/1920/$1
You need to create directories named 800, 1024, 1280, 1536 and 1920. You should create all images in directory named 2560 and then just run the script to create the others:
If you don’t like the default blurry edges, you can use -adaptive-resize instead of just -resize. The difference is similar to using Cubic vs Lanczos algorithm when scaling in Gimp.
For more detailed explanation and code that packs the images into texture atlas, continue reading this post on my blog: