Page 1 of 1

How 2 render text with different colors in one window?

Posted: Sun Sep 06, 2009 09:16
by singbol
Hi,
I'm here for game's chatting window, I want to make the text showed in the window with different colors, likes:
//////////////////////////////////////
//[clr green]Hey[/clr green],[clr red]I want//
//to be a [/clr red][clr brown]good man //
//[/clr brown]and [smiles 1]~@~[/smiles 1//
//////////////////////////////////////

How can I get this effect?

Re: How 2 render text with different colors in one window?

Posted: Sun Sep 06, 2009 11:10
by CrazyEddie
We're only adding integrated support for this type of thing starting with the 0.7.0 release (that should be made around next weekend, give or take a few days).

To do this in earlier versions you'll need to come up with some custom solution whereby you manually split the string into component sub-strings and draw them all separately; how exactly you do this, and how easily it's achieved (the rendering part, I mean) will depend upon the type of element you're rendering - there's unlikely to be a generic solution without modifying the CEGUI code, but if you're going that route, you might as well use the v0-7 code that already contains some level of support for this.

CE.

Re: How 2 render text with different colors in one window?

Posted: Sun Sep 06, 2009 11:57
by singbol
:D
Glad to hear that~~~I'm so excited !
and how about the world map?I've already written one but not support circle one~~~(I mean the map looks like circle)
Waiting for your fruit!! :wink:

Re: How 2 render text with different colors in one window?

Posted: Mon Sep 07, 2009 08:44
by CrazyEddie
Circular elements are much more of a challenge; probably not impossible, but to have a circular style mini-map, perhaps like in WoW, much more would have to be done on the app side, since such support is not integrated in CEGUI.

CE.

Re: How 2 render text with different colors in one window?

Posted: Tue Sep 08, 2009 01:48
by singbol
Ok, then I know I have to do it by myself~ :(
Another question, is it easy to make this style of tabcontrol like following:
////// ////// //////
Tab1 Tab2 Tab3
////// ////// //////
/////// /////// ///////
Tab4 Tab5 Tab6
/////// /////// ///////
I mean the multiline tabs, now I implement it just by using image buttons and control the
child window manually.

Re: How 2 render text with different colors in one window?

Posted: Tue Sep 08, 2009 09:23
by CrazyEddie
IIRC the tab control has the scroll buttons when there are too many tabs buttons, as far as I'm aware it does not currently support multiple rows of tab buttons.

CE.

Re: How 2 render text with different colors in one window?

Posted: Tue Sep 08, 2009 15:27
by singbol
Ok, In all, Thank you for your patient reply~!~I think I should use image buttons to simulate that.