Help! XML and particles.

Put your problem here if it does not fit any of the other categories.

Help! XML and particles.

Postby Fishsticks » Mon Mar 28, 2011 11:14 am

Hi there, I hope someone can help me out with this doosey.

I've got the engine AndEngine intergrated into my project, and I'm using the particle engine in one instance. I won't go into full detail of how I'm running it, only that I need to be able to load the textures and arguments for the particle effects from a single XML file.

Think of it as a large list, which has about 50 particle effects to choose from (Water, Fire, Flare, etc). When I select any of them, I want the project to read the XML file, find said particle effect, and load whatever necessary (is this what you would call dynamic?).

I'm not entirely skilled at Java/Android programming, so I was hoping someone could please help me out with this.

This is an example of how the XML file would look like, in case I'm not very good at explaining it:

Code: Select all
<particle effect>
<name>Water</name>
<texture>water_texture.png</texture>
<misc options></misc options>
</particle effect>

<particle effect>
<name>Fire</name>
<texture>fire_texture.png</texture>
<misc options></misc options>
</particle effect>


Thanks again.
Fishsticks
Freshman
Freshman
 
Posts: 3
Joined: Mon Mar 28, 2011 11:03 am

Top

Re: Help! XML and particles.

Postby Fishsticks » Thu Mar 31, 2011 11:30 am

Can someone please help me with this?
Fishsticks
Freshman
Freshman
 
Posts: 3
Joined: Mon Mar 28, 2011 11:03 am

Re: Help! XML and particles.

Postby raj_J2ME » Thu Mar 31, 2011 12:33 pm

Hi and welcome to the Android Forums.. :)

Think of it as a large list, which has about 50 particle effects to choose from (Water, Fire, Flare, etc). When I select any of them, I want the project to read the XML file, find said particle effect, and load whatever necessary (is this what you would call dynamic?).


Yeah that is something called as dynamic management of the effects. All you need to read the XML and after parsing the same you need to fetch the data and then use that.

I would recommend you that if you are reading the whole information from the XML then you should also read the Image from the XML also, this way you can make the image look and feel dynamic also. There are various parsers around which can be used.

Are you facing some issue while implementing this?

This link might help you.
http://www.androidpeople.com/android-xml-parsing-tutorial-using-saxparser/
Thanks with Regards,
Raj - The Kernel
raj_J2ME
Master Developer
Master Developer
 
Posts: 311
Joined: Tue Feb 15, 2011 7:40 am
Location: The Capital of India,

Top

Return to Other Coding-Problems

Who is online

Users browsing this forum: No registered users and 30 guests