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?
How 2 render text with different colors in one window?
Moderators: CEGUI MVP, CEGUI Team
- CrazyEddie
- CEGUI Project Lead
- Posts: 6760
- Joined: Wed Jan 12, 2005 12:06
- Location: England
- Contact:
Re: How 2 render text with different colors in one window?
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.
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.
Useful Links: Forum Guidelines | Documentation | Tutorials | HOWTO | Videos | Donate to CEGUI | CEGUI Twitter
Re: How 2 render text with different colors in one window?
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!!
- CrazyEddie
- CEGUI Project Lead
- Posts: 6760
- Joined: Wed Jan 12, 2005 12:06
- Location: England
- Contact:
Re: How 2 render text with different colors in one window?
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.
CE.
Useful Links: Forum Guidelines | Documentation | Tutorials | HOWTO | Videos | Donate to CEGUI | CEGUI Twitter
Re: How 2 render text with different colors in one window?
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.
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.
- CrazyEddie
- CEGUI Project Lead
- Posts: 6760
- Joined: Wed Jan 12, 2005 12:06
- Location: England
- Contact:
Re: How 2 render text with different colors in one window?
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.
CE.
Useful Links: Forum Guidelines | Documentation | Tutorials | HOWTO | Videos | Donate to CEGUI | CEGUI Twitter
Re: How 2 render text with different colors in one window?
Ok, In all, Thank you for your patient reply~!~I think I should use image buttons to simulate that.
Return to “Offtopic Discussion”
Who is online
Users browsing this forum: No registered users and 5 guests