Hi, all.
Just like in the MSN, we will need to send faces or other larger images,
when chatting.
I'm writing a chatbox, how can I display text mixed with freely placed images? Is it possible just using a ItemListbox with my own ItemEnty?
Any suggestion will be appreciated.
How to add images "freely" among text.
Moderators: CEGUI MVP, CEGUI Team
- CrazyEddie
- CEGUI Project Lead
- Posts: 6760
- Joined: Wed Jan 12, 2005 12:06
- Location: England
- Contact:
Hi,
To do it 'freely' is pretty difficult at the moment.
The "best" way is probably to encode all the information in the text string and parse that into a sequence of sub-strings and images that you then render.
CE.
To do it 'freely' is pretty difficult at the moment.
The "best" way is probably to encode all the information in the text string and parse that into a sequence of sub-strings and images that you then render.
CE.
Useful Links: Forum Guidelines | Documentation | Tutorials | HOWTO | Videos | Donate to CEGUI | CEGUI Twitter
Thanks for your reply, CE. You are alwlays patient, and your replies are helpful.
As there is no easy way, I'll have to create a new window type like "RichEditbox".
I've read some of the source files of CEGUI. But I didn't find where to put my window's text and images to the renderer.
How is a CEGUI window get itself rendered?
There is a
method in the Window class. But none of the derived class override it, like Editbox, MultiLineEditbox, etc.
So, if i want to mentain the content myself, how can I get my content rendered?
[/code]
As there is no easy way, I'll have to create a new window type like "RichEditbox".
I've read some of the source files of CEGUI. But I didn't find where to put my window's text and images to the renderer.
How is a CEGUI window get itself rendered?
There is a
Code: Select all
virtual void populateRenderCache()
method in the Window class. But none of the derived class override it, like Editbox, MultiLineEditbox, etc.
So, if i want to mentain the content myself, how can I get my content rendered?
[/code]
- CrazyEddie
- CEGUI Project Lead
- Posts: 6760
- Joined: Wed Jan 12, 2005 12:06
- Location: England
- Contact:
Hi,
The rendering is handled by a separate object called a CEGUI::WindowRenderer (the defaults for these are in the FalagardWRBase module). The idea is that the core functionality of any given widget type should totally independent of it's visual aspect, so in CEGUI we have these two items separate (with varying degrees of success; but hey, it's a work in progress ).
The default approach we use in the library is for the WindowRenderer for a given widget type to get most of it's basic form via a falagard looknfeel WidgetLook specification. WindowRenderer types are mapped to Window types along with a LookNFeel within the scheme file.
Having said this, the use of the WindowRenderer is not a requrement; certainly not for user project widgets where customisation is less of an issue than it is for us as library providers You can just as easily dispense with WindowRenderer objects and override that populateRenderCache function.
One key thing to understand is that when you 'draw' things in that function (or via the WindowRenderer), you're not actually drawing it immediately; rather you're queueing things to be drawn at a later time. You do this by using the Window objects RenderCache, and add images and text strings to that, which will be drawn later at an appropriate time.
Anyway, take a look in the FalagardWRBase files, since that's where the rendering 'action' takes place.
HTH
CE
The rendering is handled by a separate object called a CEGUI::WindowRenderer (the defaults for these are in the FalagardWRBase module). The idea is that the core functionality of any given widget type should totally independent of it's visual aspect, so in CEGUI we have these two items separate (with varying degrees of success; but hey, it's a work in progress ).
The default approach we use in the library is for the WindowRenderer for a given widget type to get most of it's basic form via a falagard looknfeel WidgetLook specification. WindowRenderer types are mapped to Window types along with a LookNFeel within the scheme file.
Having said this, the use of the WindowRenderer is not a requrement; certainly not for user project widgets where customisation is less of an issue than it is for us as library providers You can just as easily dispense with WindowRenderer objects and override that populateRenderCache function.
One key thing to understand is that when you 'draw' things in that function (or via the WindowRenderer), you're not actually drawing it immediately; rather you're queueing things to be drawn at a later time. You do this by using the Window objects RenderCache, and add images and text strings to that, which will be drawn later at an appropriate time.
Anyway, take a look in the FalagardWRBase files, since that's where the rendering 'action' takes place.
HTH
CE
Useful Links: Forum Guidelines | Documentation | Tutorials | HOWTO | Videos | Donate to CEGUI | CEGUI Twitter
Hey, here is a post that might interest you: http://www.cegui.org.uk/phpBB2/viewtopic.php?t=339
but be double-triple-sure to verify the code before you add it to your cegui, I remember there were little memory overflows that make the game crash here and then, if they are not fixed.
but be double-triple-sure to verify the code before you add it to your cegui, I remember there were little memory overflows that make the game crash here and then, if they are not fixed.
Return to “Modifications / Integrations / Customisations”
Who is online
Users browsing this forum: No registered users and 6 guests