Ren'Py Text size [SOLVED]

U

User_286102

Guest
Guest
Hi friends

I created a button to call a list, the list of characters in the game....
this list appears in a frame, vbox...
but now this list is too long.
I have several options....
1. put the rest of the list to be next to the top of the list... I don't like it
2. reduce the number of characters... no!!!!!
3. reduce the size of the text so that the list is shorter... I like it

I can reduce the text of the interface "in the gui.rpy file"but I don't like it, I only want to reduce this list.
So I created this:

Code:
vbox:
            style_prefix "yourtextstyle"
            text "Characters"
            null height 4
           " the list apear here"


style yourtextstyle_text is gui_interface
style yourtextstyle_text:
   text_size = 16
don't work:
i ve an error say: style property text_size is not known.
text_size"red arrow" 16

i've try:
text_size = 16
and
text_size "16"
 

Porcus Dev

Engaged Member
Game Developer
Oct 12, 2017
2,582
4,689
I'm not sure, but try this...
In gui.rpy:
Code:
style yourtextstyle_text:
     size 16
In script.rpy (or any other name you're using):
NOTE: I guess you haven't written the whole code, and that vbox is inside a frame as you comment, and all that inside a screen command.
Code:
vbox:
     style_prefix "yourtextstyle"
     text "Characters"
     null height 4
     " the list apear here"
 
U

User_286102

Guest
Guest
No, yourtextstyle_text in gui.rpy file don't work, the same error

yes i've a frame and a image button for open all that

here's what I did with the color
Code:
screen buttoncal():
    imagebutton auto "icon/buttoncal_%s.png" action If(renpy.get_screen("calendar"), Hide("calendar"), Show("calendar")) align (0.15, 0.02)

screen calendar():
    frame:
        xpadding 20
        ypadding 10
        xalign 0.26
        yalign 0.40

        vbox:
            style_prefix "yourstatstyle"
            align(0.60, 0.20)
            text "Calendar: [daycalendar]"
            null height 10
            image "[imagecalendar]"
            null height 10

default daycalendar = "Friday Morning"
default imagecalendar = "calendar01"

style yourstatstyle_text is gui_text
style yourstatstyle_text:
   color "#990000"
that works!!!

now what I did with the text size
Code:
screen buttonchara():
    imagebutton auto "icon/buttonchara_%s.png" action If(renpy.get_screen("test_frame"), Hide("test_frame"), Show("test_frame")) align (0.03, 0.02)

screen test_frame():
    frame:
        xpadding 20
        ypadding 20
        xalign 0.10
        yalign 0.08

        vbox:
            style_prefix "yourtextstyle"
            text "Characters"
            null height 4
            ...here the caractere list...

style yourtextstyle_text is gui_interface_text
style yourtextstyle_text:
   text_size 16
don't work ???
 

Porcus Dev

Engaged Member
Game Developer
Oct 12, 2017
2,582
4,689
No, yourtextstyle_text in gui.rpy file don't work, the same error

yes i've a frame and a image button for open all that

here's what I did with the color
Code:
screen buttoncal():
    imagebutton auto "icon/buttoncal_%s.png" action If(renpy.get_screen("calendar"), Hide("calendar"), Show("calendar")) align (0.15, 0.02)

screen calendar():
    frame:
        xpadding 20
        ypadding 10
        xalign 0.26
        yalign 0.40

        vbox:
            style_prefix "yourstatstyle"
            align(0.60, 0.20)
            text "Calendar: [daycalendar]"
            null height 10
            image "[imagecalendar]"
            null height 10

default daycalendar = "Friday Morning"
default imagecalendar = "calendar01"

style yourstatstyle_text is gui_text
style yourstatstyle_text:
   color "#990000"
that works!!!

now what I did with the text size
Code:
screen buttonchara():
    imagebutton auto "icon/buttonchara_%s.png" action If(renpy.get_screen("test_frame"), Hide("test_frame"), Show("test_frame")) align (0.03, 0.02)

screen test_frame():
    frame:
        xpadding 20
        ypadding 20
        xalign 0.10
        yalign 0.08

        vbox:
            style_prefix "yourtextstyle"
            text "Characters"
            null height 4
            ...here the caractere list...

style yourtextstyle_text is gui_interface_text
style yourtextstyle_text:
   text_size 16
don't work ???
"text_size" isn't correct, just put "size 16"
 
U

User_286102

Guest
Guest
Yes I've seen this, but it doesn't work in frames and vbox
I don't receive an error but the text size doesn't change
 

Porcus Dev

Engaged Member
Game Developer
Oct 12, 2017
2,582
4,689
Yes I've seen this, but it doesn't work in frames and vbox
I don't receive an error but the text size doesn't change
I don't know how you put the "carectere list", but if you use "text", you can try this:
Code:
screen test_frame():
    frame:
        xpadding 20
        ypadding 20
        xalign 0.10
        yalign 0.08

        vbox:
            text "{size=24}{color=#ffffff}Characters"  ## another size/color
            null height 4
            text "{size=16}{color=#000000}first caractere..."
            text "{size=16}{color=#000000}second caractere..."
 
U

User_286102

Guest
Guest
no unfortunately I don't use a simple "text" but a "button text"

Code:
if renpy.get_screen("amelia01"):
                textbutton "Amelia" action Hide("amelia01") sensitive iknowamelia==True
            else:
                textbutton "Amelia" action Show("amelia01") sensitive iknowamelia==True
I can't put the size and color code in this line
 

Porcus Dev

Engaged Member
Game Developer
Oct 12, 2017
2,582
4,689
no unfortunately I don't use a simple "text" but a "button text"

Code:
if renpy.get_screen("amelia01"):
                textbutton "Amelia" action Hide("amelia01") sensitive iknowamelia==True
            else:
                textbutton "Amelia" action Show("amelia01") sensitive iknowamelia==True
I can't put the size and color code in this line
Yes, you can in the same way:
Code:
if renpy.get_screen("amelia01"):
                textbutton "{size=16}Amelia" action Hide("amelia01") sensitive iknowamelia==True
            else:
                textbutton "{size=16}Amelia" action Show("amelia01") sensitive iknowamelia==True
 
  • Like
Reactions: User_286102
U

User_286102

Guest
Guest
Oh yes that work... so nice

directly on the character's name and not in the line, it makes sense
I tried but I put it in the line, like you did for the example with the "text"

again a very big thank you mgomez0077 you are the best
 
  • Like
Reactions: Porcus Dev

Porcus Dev

Engaged Member
Game Developer
Oct 12, 2017
2,582
4,689
Or...are you tried this?:
Code:
screen buttonchara():
    imagebutton auto "icon/buttonchara_%s.png" action If(renpy.get_screen("test_frame"), Hide("test_frame"), Show("test_frame")) align (0.03, 0.02)

screen test_frame():
    frame:
        xpadding 20
        ypadding 20
        xalign 0.10
        yalign 0.08

        vbox:
            style_prefix "yourtextstyle"
            text "Characters"
            null height 4
            ...here the caractere list...

style yourtextstyle_text:
   size 16
 

Porcus Dev

Engaged Member
Game Developer
Oct 12, 2017
2,582
4,689
Oh yes that work... so nice

directly on the character's name and not in the line, it makes sense
I tried but I put it in the line, like you did for the example with the "text"

again a very big thank you mgomez0077 you are the best
You're welcome ;)

You can try the last example, I think it might work, too.
 
U

User_286102

Guest
Guest
Or...are you tried this?:
Code:
screen buttonchara():
    imagebutton auto "icon/buttonchara_%s.png" action If(renpy.get_screen("test_frame"), Hide("test_frame"), Show("test_frame")) align (0.03, 0.02)

screen test_frame():
    frame:
        xpadding 20
        ypadding 20
        xalign 0.10
        yalign 0.08

        vbox:
            style_prefix "yourtextstyle"
            text "Characters"
            null height 4
            ...here the caractere list...

style yourtextstyle_text:
   size 16
this is change only the word "Characters" ahah
 

Porcus Dev

Engaged Member
Game Developer
Oct 12, 2017
2,582
4,689
this is change only the word "Characters" ahah
No, instead of this:
Code:
style yourtextstyle_text is gui_interface_text
style yourtextstyle_text:
   text_size 16
Just try this:
Code:
style yourtextstyle_text:
   size 16
 
U

User_286102

Guest
Guest
Yes i do that
i delete the first line
that change only the word Characters

Characters appear in the frame too
characters change size but not the text button with characters name
It's weird

but the other solution work fine thank you
 

Porcus Dev

Engaged Member
Game Developer
Oct 12, 2017
2,582
4,689
Ups, yes, of course, because you use "textbutton" instead of "text", sorry...

Perhaps this works:
Code:
style yourtextstyle_button_text:
   size 16
:)
 
U

User_286102

Guest
Guest
Oh, yeah, you're right, it works with that one.
you found just after I changed all the characters one after one :cry:
 
  • Haha
Reactions: Porcus Dev

Porcus Dev

Engaged Member
Game Developer
Oct 12, 2017
2,582
4,689
Good!

Styles are sometimes difficult to understand in Renpy... it would be nice if it were as easy as with a text editor :LOL::p
 
U

User_286102

Guest
Guest
Yes sometime hard to understand but not for you...
most people find a solution when there is a problem...
you, you find two solutions:LOL:
 

Porcus Dev

Engaged Member
Game Developer
Oct 12, 2017
2,582
4,689
Oh, believe me, for me too o_O:p
I'm just a little padawan learning new things day by day, and in part it is thanks to all those who are willing to share their knowledge. This is the great thing about the internet (and this forum), sharing! :D
 
  • Like
Reactions: User_286102