O'Reilly logo

Haxe Game Development Essentials by Jeremy McCurdy

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Understanding the XML file

We've been working with XML many times over the course of this book. Any time we needed to change project settings, we had edited the Project.xml file. Now we're going to see how to use our own XML file.

The strings.xml file will allow us to change all text in the game from one spot, so if there's a typo somewhere, you won't have to hunt through the codebase to find it. This will also make it easier to translate the game into another language, as you can swap out the XML with a translated version very quickly.

Looking at the file's contents

Let's have a look at the strings.xml file to see what's in it:

<?xml version="1.0" encoding="utf-8" ?> <data> <string id="TAP_TO_START"><![CDATA[- TAP TO START -]]></string> <string id="HEALTH"><![CDATA[HEALTH: ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required