Re: Label batch drawing problems

57 views
Skip to first unread message

Nathan

unread,
Sep 5, 2012, 12:40:17 AM9/5/12
to pyglet...@googlegroups.com
On Mon, Sep 3, 2012 at 3:30 PM, darkfeline <cyber...@gmail.com> wrote:
I'm running into a weird bug with drawing Labels in batches.  Because I want loose coupling between game data and the view,  I've come up with the following model:  game objects create their sprites (and Labels), and then adds them to a Batch (and OrderedGroup) via an event system.  This works fine for the sprites, but I'm running into problems trying to get the labels to draw.

Here's how the labels are added to the batch: http://pastebin.com/DjRa2eHL

I've checked coordinates and colors and draw order, and none of those seem to be the problem.  I have gotten *one* Label to draw properly, a custom FPS class whose text is updated every second.  However, this only draws a second after the game starts (presumably when the text is updated).  However, updating the text on the other Labels don't make them draw.

I'll admit I'm still getting to know pyglet, so if I'm forgetting something simple, please forgive me.  But this bug is giving me a hell of a headache, so any help is appreciated.

I read through your code, and didn't notice anything glaringly obvious to someone who doesn't use Groups and Batches.

~ Nathan 

darkfeline

unread,
Sep 6, 2012, 3:30:40 PM9/6/12
to pyglet...@googlegroups.com

On Wednesday, September 5, 2012 12:40:19 AM UTC-4, Nathan wrote:

I read through your code, and didn't notice anything glaringly obvious to someone who doesn't use Groups and Batches.

~ Nathan 


Don't use Groups and Batches!  Do you draw sprites individually?

Nathan

unread,
Sep 6, 2012, 4:55:13 PM9/6/12
to pyglet...@googlegroups.com
Oops, mispoke!  I use Sprites and Batches.  I haven't had to deal with that for so long that I forgot the batch was involved.

~ Nathan
Reply all
Reply to author
Forward
0 new messages