Background color of CUILabel : public GG::TextControl

Programmers discuss here anything related to FreeOrion programming. Primarily for the developers to discuss.

Moderator: Committer

Post Reply
Message
Author
Eloque
Space Squid
Posts: 53
Joined: Mon Jul 21, 2014 11:56 am

Background color of CUILabel : public GG::TextControl

#1 Post by Eloque »

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.
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.

User avatar
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

#2 Post by Geoff the Medio »

Maybe ->Control::SetColor(...) ?

I don't think TextControl is intended to allow setting a background colour.

Eloque
Space Squid
Posts: 53
Joined: Mon Jul 21, 2014 11:56 am

Re: Background color of CUILabel : public GG::TextControl

#3 Post by Eloque »

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?
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.

Eloque
Space Squid
Posts: 53
Joined: Mon Jul 21, 2014 11:56 am

Re: Background color of CUILabel : public GG::TextControl

#4 Post by Eloque »

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.

User avatar
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

#5 Post by Geoff the Medio »

Eloque wrote:...is there somewhere to set the alignment of text?
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.

Post Reply