I am trying to create a TextField with a text in arabic. I want to color each letter differently.
I saw a response of
@hgy29 that uses "\e[color=#..]".
I tried by passing an arabic text:
c1 = utf8.char(1602)
c2 = utf8.char(1604)
c3 = utf8.char(1605)
local tt = TextField.new(arabic_font, "\e[color=#f0f]"..c1.."\e[color=#f00]"..c2..c3)
--c1 is the red letter
tt:setPosition(100,100)
self:addChild(tt)
local tt2 = TextField.new(arabic_font, c1..c2..c3)
tt2:setPosition(100,130)
self:addChild(tt2)
It shows:
Thank you in advance
Comments
Likes: rrraptor
@hassan yep I tried the code but that doesn't work. I think "\e[color=#..]" breaks the ligatures of the letters.
There should be another way of doing this, will have to experiment more.
Likes: MoKaLux
Likes: MoKaLux