Basically, I wonder if I can do something like:
Code: Select all
frame:
background Solid("#ffffff")
xsize 50
ysize 50
corner-radius 10
Code: Select all
frame:
background Solid("#ffffff")
xsize 50
ysize 50
corner-radius 10
Code: Select all
init python:
class myButton(renpy.Displayable):
def __init__(self, xpos=0, ypos=0, width=160, height=160 **kwargs):
super(myButton, self).__init__(**kwargs)
self.color = "#000"
self.xpos = xpos
self.ypos = ypos
self.width = width
self.height = height
def render(self, width, height, st, at):
render = renpy.Render(config.screen_width, config.screen_height)
canvas = render.canvas()
canvas.rect(self.color, [self.xpos, self.ypos, self.width, self.height])
return render
def event(self, ev, x, y, st):
color = self.color
if (x > self.xpos and y > self.ypos and x < (self.xpos + self.width) and y < (self.ypos + self.height)):
color = "#fff"
else:
color = "#000"
if color != self.color:
self.color = color
renpy.redraw(self, 0)
screen button_test():
add "#252730"
add myButton(20, 20, 160, 160)
add myButton(300, 50, 64, 64)
label start:
call screen button_test
return
Users browsing this forum: Google [Bot], TioNick