Help

i have a several amount of image and try to put on panda screen to simulate a movie i use

def showImageOnScreen(self):
    x=0
    self.imageObject = OnscreenImage(image = '1715/17150000_0.jpg', pos = (-0.5, 0, 0.02))
    
def showImageOnScreenN(self):
    self.imageObject.setImage('1715/17150001_0.jpg')

and is working
but if i try tu put

def showImageOnScreenN(self):

for i in imgaeData: self.imageObject.setImage(i)
print “image change”

inside in a loop only see a message image change
but not change the image (imageData is a list with the path of the image)

and i need change 1 image per secon and show that image in the screen

It sounds like you need to yield control after you change an image, to give the system time to draw the new screen with it in it.

One option is to create a task, which is a procedure that gets called every frame. It can decide whether to change the imageObject or not.

yes that sound very good
the only think is i need launch that task with a bottom command, is that possible?

I think you mean “command button”.

Yes, it should be. When the button is pressed, you can either start the task directly:

lambda: taskMgr.add( ... )

which is then called (you might need an argument which you ignore, I forget), or call a function that starts the task.