Florian, your references showed how to make a sprite from a label, and
other things,  where-as i am interested in making sprites for
individual characters.  i figured it out like so:

def on_draw(self):

        text = 'a'
        text_size = 24

        # load font
        arial = font.load('Arial', text_size, bold=False, italic=False)

        # get a list of glyphs for each char in text (all one of them in this
case)
        glyphs = arial.get_glyphs(text)

        # make an abstract_image from a glyph in glyphs
        abstract_img = glyphs[0].get_region(0, 0, glyphs[0].width,
glyphs[0].height)

        # make a sprite from that abstract_image
        spr = pyglet.sprite.Sprite(abstract_img, x=50, y=50)

        spr.draw()

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

Reply via email to