On Sun, Feb 28, 2010 at 7:56 AM, Tristam MacDonald <[email protected]>wrote:
> On Sun, Feb 28, 2010 at 10:53 AM, Alex V <[email protected]> wrote: > >> Hi guys, >> >> I'm trying to perform some text scaling and I don't care it pixelates >> as I scale it up, I just need the method to be fast and doesn't >> regenerate the glyphs on each draw. >> >> I also need to do it in such way that is compatible with batch >> rendering, that means It doesn't have to require a opengl state change >> (is it that how it's called?) like doing a glScalef() surrounded by >> glPushMatrix glPopMatrix...as far as I know you can't put a lot of >> text labels in a single batch and do a a glScalef on a single label of >> the batch, is that right? >> >> so, in short: how can I have 50 labels (or ScrollableTextLayout) in a >> single batch, and scale 1 label of that batch without regenerating the >> glyphs,I don't care if it stretches the vertex_lists and the text >> looks weird and pixelated.. in fact, that is quite exactly what I'm >> looking for. >> >> any hints?? thanks!! >> > > One simple approach would be to create the labels with a different value > for the font_size attribute... > As I understood it, he wanted to do this on an existing label without remaking its glyphs, and wanted it to be fast.... @Alex V: If you look inside pyglet's code for moving text (in the text layout code), you'll see where it translates text by adding a constant offset to all necessary glyph quad vertices, inside their existing vertex list. Maybe you could do a monkeypatch (or suitable subclassing) to add your own similar code, to do a more general transformation on all the vertices in all the text quads, like scaling. If you want to do this many times to the same label, you'll need to avoid accumulating numeric errors. Maybe using integer coordinates can work for that. If not, you might need to save an original untransformed copy of all the vertex data. - Bruce Smith -- 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.
