Tasho 244 Posted October 7, 2015 Share Posted October 7, 2015 (edited) Hi, I wanted to teste the alpha image trigger but I can't make it work si I come to you : what I did: class SpecialBoard(ui.ImageBox): timeToFade = 0.100 interval = 0.1 fadeIn = 0 fadeOut = 0 currentTime = 0 intervallEndTime = 0 currentAlphaValue = 0 def __init__(self): ui.ImageBox.__init__(self) def __del__(self): ui.ImageBox.__del__(self) def LoadImage(self, imageName): ui.ImageBox.LoadImage(self, imageName) self.SetAlpha(0.0) def SetAlpha(self, alpha): self.currentAlphaValue = alpha ui.ImageBox.SetAlpha(self, alpha) def OnUpdate(self): self.currentTime = time.clock() if self.fadeIn == 1 or self.fadeOut == 1: if self.currentAlphaValue < 1.0 and self.currentAlphaValue >= 0.0: if self.currentTime >= self.intervallEndTime: newAlphaValue = self.currentAlphaValue if self.fadeIn == 1: newAlphaValue += self.interval else: newAlphaValue -= self.interval self.SetAlpha(newAlphaValue) self.intervallEndTime = self.currentTime + self.timeToFade else: self.fadeIn = self.fadeOut = 0 def FadeIn(self): self.Show() self.SetAlpha(0.0) self.fadeOut = 0 self.intervallEndTime = self.currentTime + self.timeToFade self.fadeIn = 1 def FadeOut(self): self.Show() self.SetAlpha(1.0) self.fadeIn = 0 self.intervallEndTime = self.currentTime + self.timeToFade self.fadeOut = 1 def fadeProgressFinished(self): if self.fadeIn == 0 and self.fadeOut == 0: return 1 else: return 0 for ex: self.Board = SpecialBoard() self.Board.SetSize(720, 530) self.Board.SetCenterPosition() self.Board.Show() self.Image = ui.ImageBox() self.Image.SetParent(self.Board) self.Image.SetPosition(-165, -50) self.Image.LoadImage("loading/1.tga") self.Image.interval = 0.1 self.Image.timeToFade = 0.1 self.Image.Show() self.EndLogin.Hide() And nothing happens, what I missed? Edited October 7, 2015 by Tasho Link to comment Share on other sites More sharing options...
Tasho 244 Posted October 9, 2015 Author Share Posted October 9, 2015 up Link to comment Share on other sites More sharing options...
Tasho 244 Posted October 10, 2015 Author Share Posted October 10, 2015 up? Link to comment Share on other sites More sharing options...
Tasho 244 Posted October 11, 2015 Author Share Posted October 11, 2015 someone? :-s Link to comment Share on other sites More sharing options...
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now