All pastes #16388 Raw Edit

Miscellany

public text v1 · immutable
#16388 ·published 2005-06-29 19:01 UTC
rendered paste body
XmlDocument docXML = new XmlDocument();
docXML.Load("animation.xml");

//gets all the elements under the name tag root
XmlNodeList root = docXML.GetElementsByTagName("root");

for(int i = 0; i < root[0].ChildNodes.Count; ++i)
{
	XmlNode animation = root[0].ChildNodes[i];

	// Parse Animation Info Here
	Animation anim = new Animation(name, loop, animation.ChildNodes.Count);
	animController.AddAnimation(anim);

	for(int j = 0; j < animation.ChildNodes.Count; ++j)
	{
		// Frames
		XmlNode frame = animation.ChildNodes[j];

		// Parse frame data here

		AnimationFrame animFrame = new AnimationFrame(texture, delay, top, left, bottom, right);
		anim.AddFrame(animFrame, j);
	}
}