Code: Select all
def overlay(self):
if self.enable:
for i,event in enumerate(self.list):
if unit.has_key(event.data):
img = im.Scale(unit[event.data].face['norm'],36,38)
uiat(self.step*event.pos,round(config.screen_height-self.height*0.5),-0.5,0.5)
ui.imagebutton(img,im.MatrixColor(img,im.matrix.brightness(0.25)), clicked=unit[event.data].point)
uiat(self.step*event.pos,1.0,-0.5,1.0)
ui.text("{size=14}{color=#0ff}%.2f"%event.time,xalign=0.5)
Method of class Unit:
Code: Select all
def point(self):
global current
current = self.id
pos = grid.rel_to_abs(self.pos)
renpy.show('pointer',what=im.MatrixColor(self.sprite,im.matrix.brightness(0.5)),at_list=[Position(xpos=pos[0],ypos=pos[1],xanchor=0.5,yanchor=1.0)],zorder=99)
renpy.with_statement(Dissolve(0.4))
renpy.hide('pointer')
renpy.with_statement(Dissolve(0.4))