Shang Publicado 27 de Junio del 2016 Reportar Compartir Publicado 27 de Junio del 2016 Hola zoneros, hace tiempo que no posteo una mierda así q me decidí a postear este object que hice hace un ratillo. Se trata de un texto que actua como botón pero sólo es texto. Código py: class TextLink(ui.Window): ## COLORS NORMAL_COLOR = grp.GenerateColor(0.7607, 0.7607, 0.7607, 1.0) OVER_COLOR = 0xff1457c7 DOWN_COLOR = 0xff0f3e8c def __init__(self): ui.Window.__init__(self) self.eventFunc = None self.eventArgs = None self.text = ui.TextLine() self.text.SetParent(self) self.text.Show() self.underline = ui.Line() self.underline.SetParent(self) self.underline.SetColor(self.NORMAL_COLOR) self.underline.Hide() def __del__(self): ui.Window.__del__(self) def SetText(self, text): self.text.SetText(text) self.SetSize(self.text.GetTextSize()[0], self.text.GetTextSize()[1]) self.underline.SetPosition(0, self.text.GetTextSize()[1]) self.underline.SetWindowHorizontalAlignCenter() self.underline.SetSize(self.text.GetTextSize()[0], 0) def OnMouseOverIn(self): self.text.SetPackedFontColor(self.OVER_COLOR) self.underline.SetColor(self.OVER_COLOR) self.underline.Show() def OnMouseOverOut(self): self.text.SetPackedFontColor(self.NORMAL_COLOR) self.underline.Hide() def OnMouseLeftButtonDown(self): self.text.SetPackedFontColor(self.DOWN_COLOR) self.underline.SetColor(self.DOWN_COLOR) self.underline.Show() def OnMouseLeftButtonUp(self): if self.eventFunc: apply(self.eventFunc, self.eventArgs) self.OnMouseOverOut() def SetEvent(self, event, *args): self.eventFunc = event self.eventArgs = args -LovePlay- y Zeler reacciono a esto 2 Citar Enlace para comentar Compartir en otros sitios Mas opciones de compartir...
-LovePlay- Publicado 27 de Junio del 2016 Reportar Compartir Publicado 27 de Junio del 2016 Muchas gracias tío, lo pondré en mi server. Citar Enlace para comentar Compartir en otros sitios Mas opciones de compartir...
Zeler Publicado 23 de Abril del 2017 Reportar Compartir Publicado 23 de Abril del 2017 Nada mas paso para agregarlo a mi cajón de ideas. Bonita función Shang reacciono a esto 1 Citar Enlace para comentar Compartir en otros sitios Mas opciones de compartir...
Shang Publicado 23 de Abril del 2017 Author Reportar Compartir Publicado 23 de Abril del 2017 Nada mas paso para agregarlo a mi cajón de ideas. Bonita función Gracias Citar Enlace para comentar Compartir en otros sitios Mas opciones de compartir...
lDesconocid0l Publicado 23 de Abril del 2017 Reportar Compartir Publicado 23 de Abril del 2017 Hola zoneros, hace tiempo que no posteo una mierda así q me decidí a postear este object que hice hace un ratillo. Se trata de un texto que actua como botón pero sólo es texto. Código py: class TextLink(ui.Window): ## COLORS NORMAL_COLOR = grp.GenerateColor(0.7607, 0.7607, 0.7607, 1.0) OVER_COLOR = 0xff1457c7 DOWN_COLOR = 0xff0f3e8c def __init__(self): ui.Window.__init__(self) self.eventFunc = None self.eventArgs = None self.text = ui.TextLine() self.text.SetParent(self) self.text.Show() self.underline = ui.Line() self.underline.SetParent(self) self.underline.SetColor(self.NORMAL_COLOR) self.underline.Hide() def __del__(self): ui.Window.__del__(self) def SetText(self, text): self.text.SetText(text) self.SetSize(self.text.GetTextSize()[0], self.text.GetTextSize()[1]) self.underline.SetPosition(0, self.text.GetTextSize()[1]) self.underline.SetWindowHorizontalAlignCenter() self.underline.SetSize(self.text.GetTextSize()[0], 0) def OnMouseOverIn(self): self.text.SetPackedFontColor(self.OVER_COLOR) self.underline.SetColor(self.OVER_COLOR) self.underline.Show() def OnMouseOverOut(self): self.text.SetPackedFontColor(self.NORMAL_COLOR) self.underline.Hide() def OnMouseLeftButtonDown(self): self.text.SetPackedFontColor(self.DOWN_COLOR) self.underline.SetColor(self.DOWN_COLOR) self.underline.Show() def OnMouseLeftButtonUp(self): if self.eventFunc: apply(self.eventFunc, self.eventArgs) self.OnMouseOverOut() def SetEvent(self, event, *args): self.eventFunc = event self.eventArgs = args Gracias por el aporte. AÚN espero el registro en esa interfaz.... Att. EW2 Citar Enlace para comentar Compartir en otros sitios Mas opciones de compartir...
veterano1998 Publicado 3 de Mayo del 2017 Reportar Compartir Publicado 3 de Mayo del 2017 Gracias por el aporte. AÚN espero el registro en esa interfaz.... Att. EW2 No creo que te de el registro es un chino de mongolia Debes iniciar sesión para ver el contenido del enlace en esta publicación. Shang, رعب حقيقي y PACI reacciono a esto 3 Citar Enlace para comentar Compartir en otros sitios Mas opciones de compartir...
PACI Publicado 3 de Mayo del 2017 Reportar Compartir Publicado 3 de Mayo del 2017 LMFAO LovePlay reacciono a esto 1 Citar Enlace para comentar Compartir en otros sitios Mas opciones de compartir...
Shang Publicado 3 de Mayo del 2017 Author Reportar Compartir Publicado 3 de Mayo del 2017 No creo que te de el registro es un chino de mongolia Debes iniciar sesión para ver el contenido del enlace en esta publicación. No tengo ni facebook tete. Citar Enlace para comentar Compartir en otros sitios Mas opciones de compartir...
Mensajes recomendados
Unirse a la conversación
Puedes publicar ahora y registrarte más tarde. Si tienes una cuenta, regístrate para publicar con su cuenta.