Just managed to work it out using a CDD
Code: Select all
init python:
import pygame
lclick = False
mclick = False
rclick = False
class GetMouse(renpy.Displayable):
def __init__(self):
super(GetMouse, self).__init__()
def render(self, width, height, st, at):
rv = renpy.Render(width, height)
return rv
def event(self, ev, x, y, st):
global lclick,mclick,rclick
lclick,mclick,rclick = pygame.mouse.get_pressed()
return None
and then i just add GetMouse() on my screen and on each imagebutton when hovered I verify if lclick or rclick are True (which they are when according buttons are pressed) and then proceed to action here is my imagebuttons
Code: Select all
for xx in range (0,10):
for yy in range (1,5):
imagebutton idle "1_percent_opaque.png" hover "1_percent_opaque.png" pos strp[(xx,yy)] anchor (0.5,1.0) hovered [If(lclick,true=SetDict(strb,yy*10+xx,True)),If(rclick,true=SetDict(strb,yy*10+xx,False))] action NullAction()
i would appreciate for any advice (maybe I doing something very wrong without notice)
Thanks, folks