navi homePPSaboutscreenshotsdownloaddevelopmentforum

Version 1 (modified by landauf, 9 years ago) (diff)


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 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 archive/XML-Writer? for an XML-Writer description