mirror of
https://github.com/Sneed-Group/Poodletooth-iLand
synced 2024-12-23 19:52:37 -06:00
TV proper loop
This commit is contained in:
parent
bacd4b365c
commit
da0366d02a
1 changed files with 9 additions and 2 deletions
|
@ -85,13 +85,20 @@ class DistributedTV(DistributedFurnitureItem):
|
||||||
self.resetScreen()
|
self.resetScreen()
|
||||||
return
|
return
|
||||||
|
|
||||||
|
start = time.time() - startTime
|
||||||
movie = loader.loadTexture(video)
|
movie = loader.loadTexture(video)
|
||||||
self.sound = loader.loadSfx(video)
|
self.sound = loader.loadSfx(video)
|
||||||
|
length = self.sound.length()
|
||||||
|
|
||||||
|
if start >= length:
|
||||||
|
start -= int(start / length) * length
|
||||||
|
|
||||||
movie.synchronizeTo(self.sound)
|
movie.synchronizeTo(self.sound)
|
||||||
self.screen.setColor(1, 1, 1, 1)
|
self.screen.setColor(1, 1, 1, 1)
|
||||||
self.screen.setTexture(movie)
|
self.screen.setTexture(movie)
|
||||||
self.screen.setTexScale(TextureStage.getDefault(), movie.getTexScale())
|
self.screen.setTexScale(TextureStage.getDefault(), movie.getTexScale())
|
||||||
self.sound.setTime(min(self.sound.length(), int(time.time() - startTime)))
|
self.sound.setTime(start)
|
||||||
|
self.sound.setLoop(True)
|
||||||
self.sound.play()
|
self.sound.play()
|
||||||
|
|
||||||
def __enterSphere(self, collisionEntry):
|
def __enterSphere(self, collisionEntry):
|
||||||
|
|
Loading…
Reference in a new issue