Chapter 8. Using Scalable Vector GraphicsA BlackBerry smartphone has a lot more computing power than the average handset, so you can't help but want to see what kinds of spectacular graphics effects you can create. Unfortunately, even the latest models don't have a 3-D graphics engine built-in. This is probably because BlackBerry devices are optimized for business and not pleasure. But, starting from operating system version 4.6.0, BlackBerry devices have Scalable Vector Graphics (SVG) capabilities (as defined in JSR 226). And that same SVG engine that so beautifully renders a corporate logo at just the right scale can also be used to add some pizazz to your game!
The main application of SVG for the gaming world is to create a fun opening video sequence for your game – or a little short to play between levels – without having to fit a ton of per-pixel movie data in your .jar or .cod file. However, it's also possible to create a game with graphics implemented entirely in SVG. SVG isn't always a practical choice for a game implementation because it takes quite a lot of computing power to create effects that are rather limited compared to what you can do with a real 3-D engine. But once you understand how it works, with a little creativity you can use its strengths to come up with a game that's quite out of the ordinary. Additionally, Scalable Vector Graphics tools like Inkscape can be helpful for creating game graphics even if you ultimately decide to export your images to a pixel-based format like PNG and implement your game with the standard graphics API.
You'll see how to do all three of these applications – and more – in this chapter.
Dr. Carol Hamer
E-mail: carol.hamer@gmail.com
To Carol's blog
Dr. Andrew Davison
E-mail: ad@fivedots.coe.psu.ac.th
To Andrew's home page