Textbutton Size changing

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
lsf22
Regular
Posts: 98
Joined: Wed Feb 23, 2022 9:43 pm
Contact:

Textbutton Size changing

#1 Post by lsf22 » Tue Mar 29, 2022 12:05 am

Ren'py version 7.4.11

I'm using my own screen and style for textbutton sizes except that I don't know what it falls under.

I've tried the following code but it doesn't work

Code: Select all

style MyGalleryUI_textbutton:
    size 33

style MyGalleryUI_interface_text_size:
    size 33
A little help appreciated for understanding this.

User avatar
Imperf3kt
Lemma-Class Veteran
Posts: 3636
Joined: Mon Dec 14, 2015 5:05 am
Location: Your monitor
Contact:

Re: Textbutton Size changing

#2 Post by Imperf3kt » Tue Mar 29, 2022 2:01 am

Edit: The below is incorrect, see Ocelot's explanation one post below for an accurate answer.


I believe textbutton text size is derived from [_prefix]_button_text_size
https://www.renpy.org/doc/html/gui.html ... _text_size

So it should look like this:

Code: Select all

style MyGalleryUI_button_text_size:
    size 33
Last edited by Imperf3kt on Tue Mar 29, 2022 3:08 am, edited 1 time in total.
Warning: May contain trace amounts of gratuitous plot.
pro·gram·mer (noun) An organism capable of converting caffeine into code.

Current project: GGD Mentor
Free Android GUI - Updated occasionally
Twitter
Imperf3kt Blackjack - a WIP blackjack game for Android made using Ren'Py

User avatar
Ocelot
Eileen-Class Veteran
Posts: 1883
Joined: Tue Aug 23, 2016 10:35 am
Github: MiiNiPaa
Discord: MiiNiPaa#4384
Contact:

Re: Textbutton Size changing

#3 Post by Ocelot » Tue Mar 29, 2022 2:20 am

test style in textbuttons is lokked up by taking style fortextbutton itself and appending _text to it.
So it sould be:

Code: Select all

style MyGalleryUI_textbutton_text:
    size 33
< < insert Rick Cook quote here > >

lsf22
Regular
Posts: 98
Joined: Wed Feb 23, 2022 9:43 pm
Contact:

Re: Textbutton Size changing

#4 Post by lsf22 » Tue Mar 29, 2022 4:04 am

I'm not getting the textbutton size to change

code used for test:

Code: Select all

# gallery screen test
#init python:

screen gallery_test:
    style_prefix "MyGalleryUI"
    
    tag menu

    add "bg_black"

    hbox:
        text "Gallery Screen Test"
        xalign 0.5
        yalign 0.0

    grid 1 6:

        xfill True
        yfill True
        xspacing 20
        yspacing 20

        textbutton "Return" action Return() xalign 0.5 yalign 0.5

        textbutton "Gallery Screen Test 2" action NullAction() xalign 0.5 yalign 0.5

        textbutton "Gallery Screen Test 3" action NullAction() xalign 0.5 yalign 0.5

        textbutton "Gallery Screen Test 4" action NullAction() xalign 0.5 yalign 0.5

        textbutton "Gallery Screen Test 5" action NullAction() xalign 0.5 yalign 0.5

        textbutton "Gallery Screen Test 6" action NullAction() xalign 0.5 yalign 0.5

style MyGalleryUI_textbutton_text:
    size 9

User avatar
Ocelot
Eileen-Class Veteran
Posts: 1883
Joined: Tue Aug 23, 2016 10:35 am
Github: MiiNiPaa
Discord: MiiNiPaa#4384
Contact:

Re: Textbutton Size changing

#5 Post by Ocelot » Tue Mar 29, 2022 4:17 am

Oh. textbuttons don't follow normal screen conmvention that default style suffix is screen element name and they use button style.

For the future: 99% of question about style can be answered using style inspector: hover over element and press Shift+I.
https://i.imgur.com/7tBlVZC.gif
< < insert Rick Cook quote here > >

Post Reply

Who is online

Users browsing this forum: No registered users