XNA, C# and XML files… how to use them?

Question by Anshakash: XNA, C# and XML files… how to use them?
I’m finding quite hard to understand how XML files can be used to define objects when working witht the XNA game creator framework…

here is an example I’ve found on a tutorial… can someone explain me what it means? how should it be interpreted?
in theory, it should set up an object… but I really can’t figure out how.
thank you





Best answer:

Answer by ejaeja
xml can be used in xna using xmlserializer class or in manual way.

From the xml provided, I guess it a simple object that has some property described. It may be a 3D level file in a simple definition.

xmlserializer class can be used if you have an object that fully set to contain all of the elements there.
what you need to do is deserialize the xml file into the object in xna.
If you dont have a definite object you can recieve an xml file and store it into any variable you declared.

read this thread, I find it quite helpful for xna xml

anyway www.3DBuzz.com has a great tutorial in a manual way of receiving xml file and store it in your code.

Add your own answer in the comments!

No related content found.


There are no revisions for this post.

Tags: ,

No comments yet.

Leave a Reply