Tuesday, July 29, 2014

Latest Android has Issues with Transparent GIFs

So I spent much of the day running around in circles trying to figure out why my game wasn't rendering transparent regions. After way too much time on this issue I eventually realized that it was a bug in Android Kitkat 4.4! How fantastically infuriating.

Well, thankfully that wasn't the only thing I did today. I also got myself all confused by Android's "density" feature. Basically, since there are a billion different devices out there and between them they all have widely different screen sizes and resolutions, Android will automatically scale bitmaps to account for the different screen DPIs. So that means that if you's using a phone (like mine) that has a very large number of pixels but is especially small, Android knows that it shouldn't make everything tiny. Usually, if you have a huge number of pixels available, software will assume it's because your screen is huge! This isn't true an high resolution smart phones so Android will make you pictures larger (in pixels) to compensate.

If you're just putting a picture on the screen this automatic scaling is really handy. If you've got your own 2D game engine this is more confusing than anything. Let's see, so I need to scale everything so it fills the screen but then all my sprites are huge because Android is already scaling them to account for the original high dpi. Double scaling!

Personally, I love high resolution displays. I would dearly love to have that on my windows box. You can sort-of do this with Windows 7 by manipulating the DPI setting, although this is mostly for text... and it breaks gadgets in Windows 7 thanks to an Exploder 11 update. Windows 8.1 apparently does it so the next screen I buy can be super high resolution.

Of course, the Mac side has been doing this for a while with the "retina" displays on MacBook pros. Super high resolution but without everything becoming tiny. Love it! Want more!


No comments: