multi-colored text

I want to create a text object with more than 1 color, 

for example “(This part is red) (This part is green)” maybe defining the text could be like this “#ff0000(This part is red) ##00ff00(This part is green)”

can this be achieved through corona ? and if not can it be achieved at all ?

I thought about creating a custom text creation function where it splits the text wherever a hex code is found and then place the text objects with different colors beside each other, is there an easier way ?

I’d go with your suggestion. There is no built in way to specify manipulations of text objects, so writing your own is the way to go.

There is a technical reason as to why this isn’t supported. Corona lives in an OpenGL graphics texture world. We want the GPU doing as much work as possible. Text is converted to an image mask using the device’s native font rendering features and that mask is applied to a colored rectangle and produces a texture that can be sent to the GPU via OpenGL and operate at the high speeds that the GPU gives us. We don’t support rich text, not because we don’t want to, but because the technology used to get from a font + text string to the GPU goes through a B&W mask.

Rob

I’d go with your suggestion. There is no built in way to specify manipulations of text objects, so writing your own is the way to go.

There is a technical reason as to why this isn’t supported. Corona lives in an OpenGL graphics texture world. We want the GPU doing as much work as possible. Text is converted to an image mask using the device’s native font rendering features and that mask is applied to a colored rectangle and produces a texture that can be sent to the GPU via OpenGL and operate at the high speeds that the GPU gives us. We don’t support rich text, not because we don’t want to, but because the technology used to get from a font + text string to the GPU goes through a B&W mask.

Rob