[Solved] Drawing a string with line break (or any \) created from "outside"

Dawn

Member
It seems \ does not work for a string variable set by included files.

For example,

draw_text(x,y,"A\nB");
This works.

str="A\nB";
draw_text(x,y,str;
This works too.

//value of str is copied from a grid created from a CSV file containing texts
draw_text(x,y,str);
This shows the text literally with no line break but \n.

I think it happened in 1.4 too but I'm not sure it's a bug or I missed something.
 

YellowAfterlife

ᴏɴʟɪɴᴇ ᴍᴜʟᴛɪᴘʟᴀʏᴇʀ
Forum Staff
Moderator
It seems \ does not work for a string variable set by included files.
\ escape sequences are only for strings inside the code.
If you want escape sequences inside externally loaded strings, you'd handle them yourself (just as you have already figured out)
 
Top