I've been playing around with the guy a bit and wanted to better visualize where CUILabels and such are placed. To this end I wanted to either make a border around them or give them a background color.
However, I am probably overlooking it, but I can't seem to figure out the methods I could use for this. SetColor just changes the textcolor, not the background.
Background color of CUILabel : public GG::TextControl
Moderator: Committer
Background color of CUILabel : public GG::TextControl
Code, justify, code - Pitr
Attached patches are released under GPL 2.0 or later, artwork and such are released under CC-BY-SA 3.0 license.
Attached patches are released under GPL 2.0 or later, artwork and such are released under CC-BY-SA 3.0 license.
- Geoff the Medio
- Programming, Design, Admin
- Posts: 13603
- Joined: Wed Oct 08, 2003 1:33 am
- Location: Munich
Re: Background color of CUILabel : public GG::TextControl
Maybe ->Control::SetColor(...) ?
I don't think TextControl is intended to allow setting a background colour.
I don't think TextControl is intended to allow setting a background colour.
Re: Background color of CUILabel : public GG::TextControl
I am starting to think you are right in that. Think there is a border possibility? I am quite new with GG and just exploring the code, can't claim much success yet.
I did find: SetBorderColor, trying that one now.
Also, that might be easier, is there somewhere to set the alignment of text?
I did find: SetBorderColor, trying that one now.
Also, that might be easier, is there somewhere to set the alignment of text?
Code, justify, code - Pitr
Attached patches are released under GPL 2.0 or later, artwork and such are released under CC-BY-SA 3.0 license.
Attached patches are released under GPL 2.0 or later, artwork and such are released under CC-BY-SA 3.0 license.
Re: Background color of CUILabel : public GG::TextControl
Scratch that, wasn't part of TextControl.
Code, justify, code - Pitr
Attached patches are released under GPL 2.0 or later, artwork and such are released under CC-BY-SA 3.0 license.
Attached patches are released under GPL 2.0 or later, artwork and such are released under CC-BY-SA 3.0 license.
- Geoff the Medio
- Programming, Design, Admin
- Posts: 13603
- Joined: Wed Oct 08, 2003 1:33 am
- Location: Munich
Re: Background color of CUILabel : public GG::TextControl
TextControl's constructor has a Flags<TextFormat> format parameter and there is a TextControl::SetTextFormat(Flags<TextFormat> format) function. The flags are defined in FontFwd.h, and there should be numerous examples in the code of their use.Eloque wrote:...is there somewhere to set the alignment of text?