"set text" from a variable is blank

  • Hello, I'm trying to update a text object with an XML file but it always turns blank. Is there a proper way to do it?

    When I store the text in a variable (global, dictionary key, or array cell), the debug mode has the value I wanted so I think it's fine on this side, but the "set text" action leaves a blank, even after a wait action to delay it. And I know it updates because the original text is "test", it just turns into nothing after the "wait".

    When I try "set text" in a basic way (without a variable) it's fine, so it doesn't seem to be a z order issue.

    So basically what I do is:

    - I have my texts in the XML file

    - On sprite clicked I create the text object and call a function with param

    - The function stores the XML text I want into a variable (seems to work), then updates the text. The debug mode shows that the text has been updated to what I want, yet it is blank ingame.

    Because this is the same result any way I try it, I'm wondering if I'm missing something with the text object?

    Also I tried to test in Chrome, Firefox and Edge, with no difference. In a previous test, I noticed only Chrome had stored the XML text and it was blank in the other browsers, so I fixed a mistake in the XML file, and now it seems fine but I don't know if that could still be an issue.

    Thanks for your help!

  • Try to publish it and then test it..

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Nvm, I tested more things after posting, and the issue was the return and indent in the xml file, combined with a small text box (my text is just a small word).

    The return / indent didn't show in the debug box, so when I clicked that box and pressed enter the text showed normally, leading me to think the return / indent was already ignored in the first place and the box size was ok. It was not, the text was bigger than the box and then simply didn't show.

    I suppressed the return / indent from the file, but is there a way to ignore it?

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