Discuss how to use the Ren'Py engine to create visual novels and story-based games. New releases are announced in this section.
Forum rules
This is the right place for Ren'Py help. Please ask one question per thread, use a descriptive subject like 'NotFound error in option.rpy' , and include all the relevant information - especially any relevant code and traceback messages. Use the code tag to format scripts.
I've tried to make an expandable button with crop but looks like this one going to be tricky. I've been changing values for half a day but can't achieve this effect. please help.
transform btnstat:
on hover:
linear 1.0 size (200, 50) crop (0, 0, 200, 50)
on idle:
linear 1.0 size (20, 50) crop (0, 0, 20, 50)
label keys:
screen key1:
imagebutton:
xalign 0.4
yalign 0.74
idle "ui/2.png"
hover "ui/2.png"
focus_mask True
action Jump("jmp1")
at btnstat
show screen key1
return
I know with adding pos (0.47,0.74) and pos (0.4,0.74) I can achieve the effect I want but I'm looking for a more efficient way to do this since I'm positioning this on different spots of screen and I might even need to move it around (or drag)
actually it's not drag to expand. it just a button that expands on hover. my only problem is I cant get it expand from one sides and it expands to the both side. is there anything like anchor that I can add to crop (0, 0, 20, 50) so it know from witch side it should crop? something similar for size can be useful when I want to keep the cropped image at center.
I'd suggest using xpos and ypos to position it, rather than xaligh and yalign. The later two set xanchor and yanchor as well, which is what is causing your problem.
Supporting creators since 2004 (When was the last time you backed up your game?)