Best way to change screens and their text on android

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
Feleven
Newbie
Posts: 10
Joined: Tue Jun 01, 2021 10:23 am
Contact:

Best way to change screens and their text on android

#1 Post by Feleven » Wed Oct 20, 2021 3:52 pm

I have a lot of screens (usually quite small) that work well on PC but not phones (small devices). Any idea what's the best way on changing them without altering the PC version?
Most of these screens have simple stuff like "text", for example:

Code: Select all

screen gameinfo():
    modal True
    add "gui/custom/picture1.png" xalign 0.5

    frame:
        background "gui/custom/blackshade5.png"
        pos (530, 723)
        maximum (870, 250)
        vbox:
            text "Tutorial" xalign 0.5 color "#E1D425" font "gui/fonts/Merienda-Regular.ttf"
            text "Tutorial text." size 23
            text "More tutorial text." size 23
            textbutton "Close" background "#000000" xalign 0.5 yalign 0.4 action Hide ("gameinfo")
I have to define the size for the PC version or it's too big, but then the android version is too small.
renpy.variant("small") works but that's a lot of duplicates

I tried making a new style with renpy.variant("small") and changing the size there like this:

Code: Select all

style newstyle:
    if renpy.variant("small"):
        size 45
    else:
        size 23
But it gives me the following error:
end of line expected.
if renpy.variant("small"):

Would appreciate any clues.

User avatar
Remix
Eileen-Class Veteran
Posts: 1628
Joined: Tue May 30, 2017 6:10 am
Completed: None... yet (as I'm still looking for an artist)
Projects: An un-named anime based trainer game
Contact:

Re: Best way to change screens and their text on android

#2 Post by Remix » Thu Oct 21, 2021 5:30 am

You duplicate the style with a declared variant to make alternatives...

Code: Select all

### Style base settings 
style newstyle:
    size 23

### Alternate settings for variants
style newstyle:
    variant "small"
    size 45
        
Frameworks & Scriptlets:

Feleven
Newbie
Posts: 10
Joined: Tue Jun 01, 2021 10:23 am
Contact:

Re: Best way to change screens and their text on android

#3 Post by Feleven » Thu Oct 21, 2021 2:49 pm

Thank you, I'll give it a go although I already managed to solve it by using if renpy.variant("small") before the style. Pretty much the same thing I guess.

Post Reply

Who is online

Users browsing this forum: mold.FF