2006-08-05, 17:00
This Python newb needs some image looping advice for the code extracts below. What is the best/easiest method to have a script simply rotate through fullscreen images in a loop (ala slideshow)? I've seen so many strange examples in scripts (that no longer work anyways) that I've confused myself. I had limited success with some very forced methods, but I would like to learn the recommended way now.
Code:
# extracted from MyClass
def showImage(self):
self.screen_image = xbmcgui.ControlImage(0,0, int(720*self.scaleX),int(480*self.scaleY), self.Pic)
self.addControl(self.screen_image)
time.sleep(10)
#self.removeControl(self.screen_image) # remove prevents domodal from seeing it. Only use adds without removes?
#self.close()
# from main loop
w = MyClass()
try:
X = 0
while not w.dying:
w.Pic = new_image_list[X]
#w.showImage() # Call it from here or in the Class init ???
w.doModal()
x += 1
if X == len(new_image_list):
X = 0
except:
print "Looping error"
del w