I followed a video to do that imagebutton, here is my code from that:
In my rpy file i have this:
In my other rpy file i have this:screen hint_screen(hints=[]):
for hint in hints:
if hint.use_outline():
imagebutton idle hint.outline:
focus_mask True
action NullAction()
hovered Function(hint.call_func)
xalign hint.x
yalign hint.y
imagebutton idle hint.img:
focus_mask True
action NullAction()
hovered Notify(hint.hint_text)
xalign hint.x
yalign hint.y
init python:
class Hint:
def __init__(self, img, outline, x, y, var_check, func, hint_text):
self.img = img
self.outline = outline
self.x = x
self.y = y
self.var_check = var_check
self.func = func
self.hint_text = hint_text
def call_func(self):
self.func()
def use_outline(self):
return self.var_check()
def seen_emp():
store.emp_seen = True
def has_seen_emp():
return not emp_seen
emp_hint = Hint("tellia.png", "tellia_idle.png", 0.5, 1.0, has_seen_emp, seen_emp, "Hey, how are you?")
default emp_seen = False