CastielL 3 Posted October 30, 2014 Share Posted October 30, 2014 (edited) Hi guys, could someone share with me a slide function for python ... I only found for php... What I mean with slide function? Something like this: Edited August 15, 2022 by Metin2 Dev Core X - External 2 Internal Link to comment Share on other sites More sharing options...
CastielL 3 Posted October 31, 2014 Author Share Posted October 31, 2014 up :-? Link to comment Share on other sites More sharing options...
Zetsu 78 Posted October 31, 2014 Share Posted October 31, 2014 Use AniImage or ExpandedImage functions(renderingrect more exactly). Link to comment Share on other sites More sharing options...
Solution ѕeмa™ 308 Posted October 31, 2014 Solution Share Posted October 31, 2014 import ui movement = 0 startness = 0 class movement_test(ui.ThinBoard): def __init__(self): ui.ThinBoard.__init__(self) self.Loadmovement_test() def __del__(self): ui.ThinBoard.__del__(self) def Destroy(self): self.Hide() return TRUE def Loadmovement_test(self): self.SetPosition(-250,120) self.SetSize(300, 300) self.Show() self.AddFlag("movable") self.AddFlag("float") self.LoadButtons() def LoadButtons(self): self.down_button = ui.Button() self.down_button.SetParent(self) self.down_button.SetPosition(285, 150) self.down_button.SetUpVisual("d:/ymir work/ui/public/Large_Button_01.sub") self.down_button.SetOverVisual("d:/ymir work/ui/public/Large_Button_02.sub") self.down_button.SetDownVisual("d:/ymir work/ui/public/Large_Button_03.sub") self.down_button.SetText("Abrir") self.down_button.SetEvent(ui.__mem_func__(self.start)) self.down_button.Show() self.up_button = ui.Button() self.up_button.SetParent(self) self.up_button.SetPosition(285, 150) self.up_button.SetUpVisual("d:/ymir work/ui/public/Large_Button_01.sub") self.up_button.SetOverVisual("d:/ymir work/ui/public/Large_Button_02.sub") self.up_button.SetDownVisual("d:/ymir work/ui/public/Large_Button_03.sub") self.up_button.SetText("Cerrar") self.up_button.SetEvent(ui.__mem_func__(self.end)) self.up_button.Hide() def start(self): global startness startness = 1 self.up_button.Show() self.down_button.Hide() def end(self): global startness startness = 2 self.up_button.Hide() self.down_button.Show() def OnUpdate(self): global startness global movement if movement < 250 and startness == 1: # Movement <250, ponemos el ancho de la board movement += 4 # Velocidad de movimiento self.SetPosition(-250+movement,120) elif not movement < 250 and startness == 1: # -250 posiion normal , 250 posicion abierto startness = 0 elif movement > 0 and startness == 2: movement -= 4 # Velocidad de movimiento self.SetPosition(-250+movement,120) elif not movement > 0 and startness == 2: startness = 0 def Show(self): ui.ThinBoard.Show(self) def Minimize(self): self.Hide() def Close(self): self.Hide() return TRUE def OnPressEscapeKey(self): self.Hide() return TRUE aaaa= movement_test() aaaa.Show() try it. have fun 2 https://m2admin.net/ Link to comment Share on other sites More sharing options...
CastielL 3 Posted October 31, 2014 Author Share Posted October 31, 2014 thanks #edit: it works, thank you so much 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