using transform with hover?
Posted: Mon Sep 13, 2010 3:36 pm
I thought about a nice effect to have on buttons using the new screen and ATL. What I wanted to make is quite simple: I have some buttons and wanted to zoom them in/out as the player hover the mouse over them.
However, I am not sure really how I could do this - I mean the imagebutton should call an action on the over? but that action can modify the transform of the imagebutton that called it?
I am a bit confused
before ATL I managed to make some effect like moving buttons using classes, like for a RPG where staves would go up/down when hovering mouse on them:
but I must admit that I wouldn't know how to reproduce that for example using the new screen/ATL system. If anyone can illuminate me (and maybe others) with an example would be welcome 
However, I am not sure really how I could do this - I mean the imagebutton should call an action on the over? but that action can modify the transform of the imagebutton that called it?
I am a bit confused
Code: Select all
class Staff(object):
def __init__(self,id,x,y):
self.x=x;self.y=y;self.id=id;self.ok=None
def show(self):
self.ok = True
renpy.store.curid=self.id;renpy.store.tipT=Eld[self.id]
renpy.sound.play("snd/e"+str(self.id+1)+".ogg")
renpy.show("staff"+str(self.id), [FactorZoom(.7, .75, 0.6, opaque=False),Position(xalign=self.x,yalign=self.y)])
renpy.restart_interaction()
def hide(self):
if self.ok:
renpy.show("staff"+str(self.id), [FactorZoom(.75, .7, 0.6, opaque=False),Position(xalign=self.x,yalign=self.y)])
renpy.store.curid=-1
self.ok = False
renpy.restart_interaction()