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.
-
Bartulisica
- Regular
- Posts: 92
- Joined: Sun Aug 30, 2015 5:11 am
- Organization: ArizonaIdentities
- Location: Croatia
- Discord: ArizonaIdentities#9377
-
Contact:
#1
Post
by Bartulisica » Sun Feb 26, 2017 10:49 am
Hello,
so I made a custom button, changed the background, edited a text a bit, and now I tried to move text so it's centered inside a background. However, text does move to wanted position but his "area" doesn't, and when I want to hover a button I have to place cursor over that old position of the text. What to do here? How do I move that area?
Code: Select all
style.button["button_style"].idle_background = "pic.png"
style.button["button_style"].hover_background = "hover_pic.png"
style.text["button_style_text"].size = 22
style.text["button_style_text"].color = ("#ffffff")
style.text["button_style_text"].pos = (50,23)
- ArizonaIdentities
-
gas
- Miko-Class Veteran
- Posts: 838
- Joined: Mon Jan 26, 2009 7:21 pm
-
Contact:
#2
Post
by gas » Sun Feb 26, 2017 9:40 pm
Add this
style.button["button_style"].ysize = 100
style.button["button_style"].xsize = 200
where 100 and 200 are the image size (use your sizes)
The don't use pos, instyead use xalign=0.5 to center in the area, and yalign=0.5 to center vertically.
Hope it works!
If you want to debate on a reply I gave to your posts, please QUOTE ME or i'll not be notified about. << now red so probably you'll see it.
10 ? "RENPY"
20 GOTO 10
RUN
-
Bartulisica
- Regular
- Posts: 92
- Joined: Sun Aug 30, 2015 5:11 am
- Organization: ArizonaIdentities
- Location: Croatia
- Discord: ArizonaIdentities#9377
-
Contact:
#3
Post
by Bartulisica » Fri Mar 03, 2017 4:13 am
I actually figured out what was the problem on my own in the meantime, and yes it was the size of button which I completely forgot about once I added backgrounds to the button. -.-
But thanks anyway, appreciate it!
- ArizonaIdentities