How do I call image from XML

0 favourites
  • 5 posts
From the Asset Store
Medeival & Viking War Horns Sounds / 22 Unique Calls / 2:40 minutes of audio
  • Hi,

    I am able to call image by adding an image in files folder and by calling in a sprite from 'load image from URI' but I want to do this through XML as I am able to call text and audio from XML but not image.

    In simple terms I want to put images in file folder and call from XML when required like this.

    <question>

    <sound>face.mp3</sound>

    <text>A face.</text>

    <good_image>face.png</good_image>

    <bad_image>leg.png</bad_image>

    </question>

    Also in files folder creating subfolder and calling image from URI is also not working. This also my main concern to call from XML.

    Regards

    M

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • [quote:exgk6486] I am able to call text and audio from XML but not image.

    so... if you set Text to

    XML.StringValue("//question/good_image/text()")[/code:exgk6486]
    you get [i]"face.png"[/i]
    
    but...  you can't load image?
     from
    [img="http://lookpic.com/O/i2/1098/m2QpNsmg.png"]
  • Yes exactly. I am not able to do this in Construct 2 but after exporting the HTML5 output I can change code but I want it natively. Please advice.

  • test this capx.... faceLeg.capx

  • Thanks Korbaach that is a great help. I am making a mistake of not using // and not getting this result. That's a great help.

    Cheers

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)