Hi!
Thanks a lot, for fast response on my previous posts.
The question for today is: How to set font color in external .font file?
Is there something like DefaultColour="0xFFFFFFFF" ?
Or at least in game code
EDIT: Ok Soved It, declaring
Property Name="TextColours" Value="tl:FF00000000 tr:FF000000 bl:FF000000 br:FF000000" />
in my .layout file helps.
Anyway, how to change font colour dynamicly within the game code?
Font colour
Moderators: CEGUI MVP, CEGUI Team
- CrazyEddie
- CEGUI Project Lead
- Posts: 6760
- Joined: Wed Jan 12, 2005 12:06
- Location: England
- Contact:
Hi,
The font does not have a colour associated with it - the colours are set individually on each window. How this is done exactly depends on the window type and maybe other things.
To change the colours at runtime, you can either use the setProperty call on the window (passing strings like you do in the layout), or depending on the exact window type there may be a direct setter (though most of these were phased out where it was possible) - you'll have to check the API docs for this since you did not specify which window type it is.
The font does not have a colour associated with it - the colours are set individually on each window. How this is done exactly depends on the window type and maybe other things.
To change the colours at runtime, you can either use the setProperty call on the window (passing strings like you do in the layout), or depending on the exact window type there may be a direct setter (though most of these were phased out where it was possible) - you'll have to check the API docs for this since you did not specify which window type it is.
I'm using a MultiLineEditBox for the output of a chat/info window. How can I set specific words that are output to be different colors/bold/etc.?
I'd love to set a FontColour property at runtime, but unfortunately I don't think MultiLineEditBox accepts that property.
Alternatively, should I be using a different type of control for chat/info output rather than MultiLineEditBox?
TIA.
I'd love to set a FontColour property at runtime, but unfortunately I don't think MultiLineEditBox accepts that property.
Alternatively, should I be using a different type of control for chat/info output rather than MultiLineEditBox?
TIA.
Arcanoria - a SMORPG project - http://www.arcanoria.com
- CrazyEddie
- CEGUI Project Lead
- Posts: 6760
- Joined: Wed Jan 12, 2005 12:06
- Location: England
- Contact:
Hi,
You can set the text colour on the MultiLineEditbox via the property "NormalTextColour"; though obviously this changes the colour of all the text and I'm guessing this is not what you want.
There is currently no quick and easy way to colour substrings (via a markup like tag, for instance). This is a much requested feature, and I have some ideas for implementation of this (in a very customisable way) for a future release, though that does not help you now.
For the chat/info window many people use Listbox instead; with each entry in the list being a line or entry in the chat output. This gives you the means to have each item / entry / line a different colour. If you were to create a custom window skin (for items added to ItemListbox) or a customised ListboxItem (for the older Listbox type), it would be possible to have 'fields' in each line that you could colour individually as required.
CE.
You can set the text colour on the MultiLineEditbox via the property "NormalTextColour"; though obviously this changes the colour of all the text and I'm guessing this is not what you want.
There is currently no quick and easy way to colour substrings (via a markup like tag, for instance). This is a much requested feature, and I have some ideas for implementation of this (in a very customisable way) for a future release, though that does not help you now.
For the chat/info window many people use Listbox instead; with each entry in the list being a line or entry in the chat output. This gives you the means to have each item / entry / line a different colour. If you were to create a custom window skin (for items added to ItemListbox) or a customised ListboxItem (for the older Listbox type), it would be possible to have 'fields' in each line that you could colour individually as required.
CE.
Thanks CE I'll give your Listbox suggestion a try.
Since you mentioned a future version of CEGUI, do you think it's something that might be released within the next 6 months, or is it a more vague plan than that? I'd be very excited to see more progress on CEGUI after all this time! There are currently quite a few competing GUI solutions for Ogre (i.e. QuickGUI, MyGUI, Navi, etc.), but none of them yet has the completeness and stability of CEGUI.
Since you mentioned a future version of CEGUI, do you think it's something that might be released within the next 6 months, or is it a more vague plan than that? I'd be very excited to see more progress on CEGUI after all this time! There are currently quite a few competing GUI solutions for Ogre (i.e. QuickGUI, MyGUI, Navi, etc.), but none of them yet has the completeness and stability of CEGUI.
Arcanoria - a SMORPG project - http://www.arcanoria.com
- CrazyEddie
- CEGUI Project Lead
- Posts: 6760
- Joined: Wed Jan 12, 2005 12:06
- Location: England
- Contact:
Hi,
We have intention to release what is currently in trunk sometime really soon. While there is not likely to be anything earth shattering in that release, obviously after 16 months there are a lot of fixes and some new things as well (like a tree widget). One of the main purposes of such a release, at least as far as I am concerned, is to draw a line under what has gone before in order to subsequently move onto bigger and better things.
A further release within six months, containing new CEGUI development, is not totally unrealistic - providing things hold together
CE.
We have intention to release what is currently in trunk sometime really soon. While there is not likely to be anything earth shattering in that release, obviously after 16 months there are a lot of fixes and some new things as well (like a tree widget). One of the main purposes of such a release, at least as far as I am concerned, is to draw a line under what has gone before in order to subsequently move onto bigger and better things.
A further release within six months, containing new CEGUI development, is not totally unrealistic - providing things hold together
CE.
You should have a look at Game Chat Box. That code allows you to use dynamic fonts (arial 10, 12, 16, etc, times new roman, etc).
There was a post with some code to wrap the text within a listbox text item. [need a link to that post]
There was a post with some code to wrap the text within a listbox text item. [need a link to that post]
Thanks Rackle. I did actually use that wiki page to help me get my Listboxes going (they work great now).
However, I didn't get as far as experimenting with dynamic fonts or long line wrapping yet. I will give them a try!
However, I didn't get as far as experimenting with dynamic fonts or long line wrapping yet. I will give them a try!
Arcanoria - a SMORPG project - http://www.arcanoria.com
Return to “Offtopic Discussion”
Who is online
Users browsing this forum: No registered users and 5 guests