Textbutton area messed up

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.
Post Reply
Message
Author
User avatar
Bartulisica
Regular
Posts: 93
Joined: Sun Aug 30, 2015 5:11 am
Organization: ArizonaIdentities
Location: Croatia
Discord: ArizonaIdentities
Contact:

Textbutton area messed up

#1 Post by Bartulisica »

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

User avatar
gas
Miko-Class Veteran
Posts: 842
Joined: Mon Jan 26, 2009 7:21 pm
Contact:

Re: Textbutton area messed up

#2 Post by gas »

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

User avatar
Bartulisica
Regular
Posts: 93
Joined: Sun Aug 30, 2015 5:11 am
Organization: ArizonaIdentities
Location: Croatia
Discord: ArizonaIdentities
Contact:

Re: Textbutton area messed up

#3 Post by Bartulisica »

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

Post Reply

Who is online

Users browsing this forum: Google [Bot]