Color in a Windows Base

Hello.

I have a little Windows Base child that i use to write some text

class Window_Choix < Window_Base #-------------------------------------------------------------------------- # * Object Initialization #-------------------------------------------------------------------------- def initialize super(624,0,400,300) contents.font.size = 16 hide end def updateText(text,clear=false) contents.clear if clear show for i in 0..text .length-1 contents.draw_text(0,16*i,600,16,text[1],0) end end endand i have this code elsewhere

@text.push("Blabla") @windowText.updateText(@text)It work fine.

My question is: since Windows Base have some color method

def process_escape_character(code, text, pos) case code.upcase when 'C' change_color(text_color(obtain_escape_param(text))) when 'I' process_draw_icon(obtain_escape_param(text), pos) when '{' make_font_bigger when '}' make_font_smaller end endhow can i color some of my text in blue ?

Some code like :

@text.push("Bla \C[5] bla")@windowText.updateText(@text)Thank you 😀
The method "draw_text_ex" in Window_Base draws text while interpreting control characters.
Be aware that if you're using a colour code in draw_text_ex, you need two backwards slashes and a capital C, or it won't work. So \\C[6] for yellow, for example.
Thank you very much, but when i change my script for this :

class Window_Choix < Window_Base #-------------------------------------------------------------------------- # * Object Initialization #-------------------------------------------------------------------------- def initialize super(624,0,400,300) contents.font.size = 16 hide end def updateChoix(text,clear=false) contents.clear if clear show for i in 0..text .length-1 draw_icon(text[0],0, 16*i) draw_text_ex(0,16*i,600,16,text[1]) end end endi get a no method error for draw_text_ex 🙁
draw_text_ex has different parameters compared to draw_text.

You need not only change the name, but also give the correct parameters for the function
Thank you, all work fine now 😀

Original thread: https://forums.rpgmakerweb.com/threads/color-in-a-windows-base.39510/