On Wed, Feb 4, 2009 at 2:22 PM, tazg <[email protected]> wrote:
>
> I'd like to set only the alpha of all the text in a document, but
> setting the color attribute will override all color settings which
> defeats the purpose of FormattedDocument. Why is there not a separate
> alpha attribute?
Because OpenGL treats alpha as a colour component, not a separate
vertex attribute, so pyglet follows this convention.
> What would be the best way to work around this be?
Something like (untested code):
run_iter = document.get_style_runs('color')
for start, end, color in list(run_iter.ranges(0, len(document.text))):
document.set_style(start, end, dict(color=modified_color))
Alex.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"pyglet-users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/pyglet-users?hl=en
-~----------~----~----~----~------~----~------~--~---