Putting an icon into scripted text

Hey guys, I'm wanting to put an icon next to a bit of text that originates from a script. Putting the regular \i[x] doesn't work, any idea how I might do this?

I've got this script assigned to control variable 39:
upload_2019-7-24_16-37-21.png

upload_2019-7-24_16-37-43.png


And some text that calls on 39 to name the season:
upload_2019-7-24_16-38-42.png


This is all linked into time common events, and it's all working fine. I like to put a seasonal icon next to the season name, but trying to add '\i[x] into the script just results in the text returning '0' instead of the name and icon. Any tips?
👋 It's a quirk of the escape code parsing mechanics. All instances of "\" get replaced with "\x1b" before substituting variable values, so you'll need to use that in your variable assignment rather than a simple backslash. Try something like this~
Code:
['\x1bI[64]Summer','\x1bI[69]Autumn','\x1bI[65]Winter','\x1bI[67]Spring'][$gameVariables.value(10)]
Hi @caethyril! Thanks, that worked perfectly!!

This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.

Original thread: https://forums.rpgmakerweb.com/threads/putting-an-icon-into-scripted-text.111396/