Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8505977
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T02:28:07+00:00 2026-06-11T02:28:07+00:00

I am attempting to use a batch in pyglet to draw labels. Currently this

  • 0

I am attempting to use a batch in pyglet to draw labels. Currently this batch is used for drawing every entity that I create, and everything draws just fine. I can add hundreds of Sprites to it and they will all be drawn, but not any labels that I create and add. I am using the latest version of pyglet from the source repository, and here is the code that I am using:

def _text(self, command):
    uid, x, y, chars, font, size, level = command[1:]
    print 'Text - uid=%s, x=%s, y=%s chars=%s, font=%s, size=%s, level=%s' % (uid, x, y, chars, font, size, level)
    self._ents[uid] = (pyglet.text.Label(chars,
        color=(0, 0, 0, 0),
        font_name=font,
        font_size=size,
        batch=self._batch,
        group=self._get_level_group(level)), level)
    print self._ents[uid][0].batch

The printed batch has the same memory address for every Label I create, and the same as what is given to any Sprites I create. I attempted to dig into the source code a bit and try to find out what was going wrong, but at every point that I printed out the batch the memory address is the same. The odd part is that when I put a print statement in a location where the Label will draw itself one way if it owns its own batch, or if it was given a batch, it will only print stuff out under the branch where it owns its own batch. If I print out the memory address of the batch at that point, it is different from every other time. Somehow it seems like it is seeing that it should own its own batch, and is creating a new one instead of the one that I provide.

EDIT: I feel dumb. It works fine with this code… once I add x=x, y=y in the Label creation code. It was defaulting to the bottom-left of the screen, and the characters I was trying to draw were underscores, so I couldn’t see them. I’ll either add an answer to this question once SO lets me, or someone else can put in an answer for the x/y thing and I’ll accept it.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T02:28:09+00:00Added an answer on June 11, 2026 at 2:28 am

    I feel dumb. It works fine with this code… once I add x=x, y=y in the Label creation code. It was defaulting to the bottom-left of the screen, and the characters I was trying to draw were underscores, so I couldn’t see them. I fixed this and now everything is fine.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Attempting to use the data series from this example no longer passes the JSONLint
In attempting to use std::select1st from <functional> in a VS2008 project I found that
Attempting to use the amazon API to obtain product data and currently failing miserably.
I am attempting to use XMLParse against content that is not valid xhtml. In
Attempting to use asp.net mvc's Action Result of File. So it would seem that
I'm attempting to use Google's Guava ImmutableSet class to create a set of immutable
I am currently attempting to use a custom module as the first page when
I am attempting to use curl commands in a batch file I am writing.
attempting to use this railscast as a guide: http://railscasts.com/episodes/197-nested-model-form-part-2?view=asciicast and running into this error:
I'm attempting to use this approach, described by Marco Arment, for checking if a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.