Label background

87 views
Skip to first unread message

anatoly techtonik

unread,
Sep 11, 2012, 9:57:47 AM9/11/12
to pyglet...@googlegroups.com
Hi,

Is it possible somehow to set background colors for text labels?

Nathan

unread,
Sep 11, 2012, 1:42:10 PM9/11/12
to pyglet...@googlegroups.com
On Tue, Sep 11, 2012 at 7:57 AM, anatoly techtonik <tech...@gmail.com> wrote:
Hi,

Is it possible somehow to set background colors for text labels?


You should probably investigate "background_group" on the Label API page:

http://pyglet.org/doc/api/pyglet.text.Label-class.html

Haven't used it myself, but it sure looks like what you're looking for.

~ Nathan

anatoly techtonik

unread,
Oct 2, 2012, 9:39:32 AM10/2/12
to pyglet...@googlegroups.com
"background_group" is still a mystery to me. I've found a way to set style:

label.set_style('background_color', palette.background)

Nathan

unread,
Oct 2, 2012, 10:29:49 AM10/2/12
to pyglet...@googlegroups.com
That looks like a nicer way to do it.  Was that documented somewhere, or did you find it in the source?

~ Nathan

anatoly techtonik

unread,
Oct 3, 2012, 1:52:03 PM10/3/12
to pyglet...@googlegroups.com
Both. Traced ancestry of Label and then found it in
http://www.pyglet.org/doc/programming_guide/formatted_text.html

Of course it will be better to have a dedicate chapter about styling text.
--
anatoly t.
Reply all
Reply to author
Forward
0 new messages