Background image wont show up.. And some code wont work

Hey, for some reason one of my background images wont show up no matter what I do. All I get is a black screen like its stuck in a loop. Neither will the text but the for loop seems to work just fine, witch happens after the text/image is setup. Whats werid is if I move the text and image around around in the code they work again.

        TextForSize = OnscreenText(text = "0", pos=(0-.1,0), scale = 0.07, mayChange=1,fg=(1,1,1,1))
        TextForDownload  = OnscreenText(text = "0", pos=(0,0), scale = 0.07,mayChange=1,fg=(1,1,1,1))
        TextForPES = OnscreenText(text = "0", pos=(.1,0), scale = 0.07,mayChange=1,fg=(1,1,1,1))
        self.Background = OnscreenImage(image = 'downloading.PNG',parent=render2d)
        for self.Download in range(1, self.Size + 1):
          if self.TempDownload != self.Download:
            self.TempDownload = self.Download
            self.PES =(100*self.Download) / self.Size
            TextForSize.setText(str(self.Size))
            TextForDownload.setText(str(self.Download))
            TextForPES.setText(str(self.PES))
            print self.PES

I’m going to say this is a bug in panda and not in my code…but I could be wrong…As for the full code it’ll be up tomar. in my game update…
Unless you all have some other thoughts as to what this could be?

Also I just found out today O.o; (it works by its self) that this code giving me a error too… witch is dum cus it works by its self.

    def unZip(self, path, Zip):
        isdir = os.path.isdir 
        join = os.path.join 
        norm = os.path.normpath 
        split = os.path.split
        for each in Zip.namelist():
          if not each.endswith('/'):
            root, name = split(each)
            directory = norm(join(path, root))
            if not isdir(directory):
              os.makedirs(directory)
          file(join(directory, name), 'wb').write(Zip.read(each))
        Zip.close()

Error

Traceback (most recent call last):
  File "Mradr.py", line 907, in <module>
    Game()
  File "Mradr.py", line 35, in __init__
    self.VersionCheck()
  File "Mradr.py", line 80, in VersionCheck
    self.unZip("", Zip)
  File "Mradr.py", line 106, in unZip
    file(join(directory, name), 'wb').write(Zip.read(each))
UnboundLocalError: local variable 'directory' referenced before assignment

you get the error cause. the " ig not each.endswith(“/”) is false. so it never asigns anything to the variable directory (or rather it doesnt exist yet), but then you call file(join(directory,name) … and directory is used the first time there.

Thanks, kk I got that fixs but the image and text still gets me… not sure whats going on there.

kk I put the game up. The zip should be there too so you can look inside the game data to see why its not showing the images. Its like the 2 boxs down.

Should look like this
img41.imageshack.us/img41/2128/errorread.png

hm did you get any warnings in the terminal?. cause you said. “one” of my images wont show up. which means you have others showing up. maybe the file is corrupt, or you have a typo in the name or so.

No warnings and thats what I thought about, image corruption, but I can open it normally and besides the image, the texts gui wont show up. So its not just the image thats at fault. The highlighted text is what wont show, I can take this code out and it works again. So w/e reason it is, is around there but I dont see what the problem is.

Oh wow O.o after some more testing. I find that the image does pop up… but AFTER the download is done, but the gui should pop up befor it even starts… not sure why this is so?

Does the gui lag some? If so that could say why… but I really dont see why it wouldnt stop up untill the for loop is done.

well you reparent it to render2d and then start downloading. there is no way panda has a chance to render the actual geometry and put it onto your screen.
so either you have to tell panda to render one or 2 frames manually after adding the image. or you have to start the downloading a few frames later (for example with doMethodLater tasks or so)