navi homePPSaboutscreenshotsdownloaddevelopmentforum

This is an archived page!
This page is very old and the content is not up to date.
Not everything (if any) which is written here will be in the final game!


The goal of the XML-Loader is to import levels defined in an XML-File into the game engine. This is done by parsing a specified XML-File and adding all defined Entities for the Scene-Manager.


See content/LevelHowTo (don't know if this is still up to date…)


This page referrers to Ticket 232 which is maintained by Nicolas Perrenoud


I'm using the xmlParser Library from Frank Vanden Berghen which is small, simple to use and fast. (Download). It uses only one class, which is defined in xmlParser.cpp, xmlParser.h The class XMLNode reflects an Node in the XML-File. It has methods to get the child nodes, get the attributes and inner text.



<level name="Argon Prime">

Lorem Ipsum dolor sit amet



XMLNode xMainNode=XMLNode::openFileHelper("level.xml","root"); This loads the xml file and defines root as the main node

XMLNode xNode=xMainNode.getChildNode("level"); This creates a new node object of child node <level>

cout << xNode.getAttribute("name"); This prints the value xNode's attribute name, in this case Argon Prime

cout << xNode.getText()); This prints the inner content of xNode, in this case Lorem Ipsum dolor sit amet


See XML-Writer for an XML-Writer description

Last modified 2 years ago Last modified on Apr 15, 2017, 3:12:02 PM