[Solved]Quick Menu in Android is tiny on hardware but not on Renpy Android Emulator

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.
Message
Author
shiolily
Newbie
Posts: 18
Joined: Fri Aug 20, 2021 5:10 am
Deviantart: shiolily
Contact:

[Solved]Quick Menu in Android is tiny on hardware but not on Renpy Android Emulator

#1 Post by shiolily »

Hello! I'm a brand new member and this is the first time I've worked on a game so sorry if I ask something really obvious or dumb. My problem is the quick menu on android- where it says 'back, skip, auto, menu' has super tiny buttons on hardware. When I view it on the renpy emulator the buttons are a normal size.

I did edit the values for the button sizes in the mobile variants section of gui.rpy and my current value is

Code: Select all

gui.quick_button_text_size = 35
This changes the size in the emulator.

Here is a screenshot of the emulator: https://cdn.discordapp.com/attachments/ ... nknown.png

And here is a screenshot of my phone. https://cdn.discordapp.com/attachments/ ... 145925.png

My phone is a pixel 3a XL running Android 10 and my windows version is Windows 10 Home, with a laptop monitor display resolution of 3840 x 2160 and a second monitor of 1920 x 1080, if this is relevant. The emulator looks the same on both monitors.
There is a similar problem with the menu in that it's large/the right size on the emulator but tiny on hardware. Even though I have small hands it's still difficult for me to press anything so I imagine everyone else will have problems too. My friend will probably test on his tablet at some point so I'll ask him for screenshots to see if he can replicate the problem.

Here are the screenshots of the menus.
The renpy emulator
https://cdn.discordapp.com/attachments/ ... nknown.png

My phone.
https://cdn.discordapp.com/attachments/ ... nknown.png

Also if I increase some values like the label value, the History name text starts clipping into the dialogue, so I'm wary of just increasing every single value.
Last edited by shiolily on Tue Aug 24, 2021 7:33 pm, edited 1 time in total.

User avatar
Jackkel Dragon
Veteran
Posts: 283
Joined: Mon Mar 31, 2014 7:17 pm
Organization: Nightshade, Team Despair
itch: jackkel-dragon
Location: USA
Contact:

Re: Quick Menu in Android is tiny on hardware but not on Renpy Android Emulator

#2 Post by Jackkel Dragon »

This may be related to a problem I've been told of with my Android releases. What is the size of the phone you're using? If Ren'Py thinks your phone is bigger than the cutoff for "small" phones, it may be running the "medium" tablet variant. (You can add a check somewhere to show the active variants to double-check this.)

In my case, I added this to the top of my gui.rpy to try to get around the issue:

Code: Select all

init python:
    ## phones and tablets can change orientation
    if renpy.variant("mobile"):
        config.has_quicksave = False

        if persistent.mobile_layout == None: ## initial check on first time running the game
            if renpy.variant("small"):
                persistent.mobile_layout = "small"
            else:
                persistent.mobile_layout = "big"

        if persistent.mobile_layout == "small": ## mobile small variant
            config.variants.append("small")
        else: ## mobile big variant
            if renpy.variant("small"):
                config.variants.remove("small")

    ## renpy variant ### specific to my game, but the below is where the gui.init is in the default gui.rpy
    if renpy.variant("small"):
        gui.init(720,1280)
    else:
        gui.init(1280,720)
Alternatively, you could change all of the default GUI "small" variants to "mobile" variants and "large" variants to "pc" variants. This may slow down adapting the game to future hardware, but will probably force Ren'Py to run the correct variants between both phone and emulator.
Main Website
Includes information about and links to many of my current and past projects.

Major Game Projects
[Nightshade] Eldritch Academy, Eldritch University, Blooming Nightshade, Flowering Nightshade, Life as Designed
[Team Despair] Corpse Party D2 series

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

Re: Quick Menu in Android is tiny on hardware but not on Renpy Android Emulator

#3 Post by Imperf3kt »

Also note that there is a section entitled mobile variants that your need to adjust in addition to the regular gui elements
Warning: May contain trace amounts of gratuitous plot.
pro·gram·mer (noun) An organism capable of converting caffeine into code.

Current project: GGD Mentor

Twitter

shiolily
Newbie
Posts: 18
Joined: Fri Aug 20, 2021 5:10 am
Deviantart: shiolily
Contact:

Re: Quick Menu in Android is tiny on hardware but not on Renpy Android Emulator

#4 Post by shiolily »

@jackkel dragon The pixel 3a XL is 6.30 x 3.00 x 0.32 in in size with a resolution of 2,160x1,080 px, so it may be possible that it's running the medium size. I'll try the code you posted and get back to this thread, thank you so much!

@Imperf3kt I did do so, in my original post I stated as such.
I did edit the values for the button sizes in the mobile variants section
But I'll go over it in case I missed something, thanks :D

shiolily
Newbie
Posts: 18
Joined: Fri Aug 20, 2021 5:10 am
Deviantart: shiolily
Contact:

Re: Quick Menu in Android is tiny on hardware but not on Renpy Android Emulator

#5 Post by shiolily »

Alright I tried these.
In my case, I added this to the top of my gui.rpy to try to get around the issue:
Put it at the top of gui.rpy and the game looks exactly the same on the phone, tiny buttons and all. For some reason it didn't change anything at all D:
Alternatively, you could change all of the default GUI "small" variants to "mobile" variants and "large" variants to "pc" variants. This may slow down adapting the game to future hardware, but will probably force Ren'Py to run the correct variants between both phone and emulator.
This worked better but introduced new problems. Namely the text going outside the text box, as seen here: https://media.discordapp.net/attachment ... 232450.png

This is how it looks on emulator, completely normal with the text placed the same way as before: https://media.discordapp.net/attachment ... eight=1340

On the bright side, the main menu and quick menu are the correct size.

https://media.discordapp.net/attachment ... nknown.png

I wonder if there is a way for the player to manually select whether they want their game to run in phone or tablet mode? Or should I tweak the values in 'mobile variants' further to fix the text box issue?

User avatar
Jackkel Dragon
Veteran
Posts: 283
Joined: Mon Mar 31, 2014 7:17 pm
Organization: Nightshade, Team Despair
itch: jackkel-dragon
Location: USA
Contact:

Re: Quick Menu in Android is tiny on hardware but not on Renpy Android Emulator

#6 Post by Jackkel Dragon »

The default GUI images for desktop and mobile devices are two separate folders, so it's possible that the broken textbox is a result of using the mobile text size on the desktop textbox image.

As for the code that I posted, I either forgot to mention the details of how it worked or forgot to clean it up more. Basically, that code sets "persistent.mobile_layout" on the first bootup based on the size of the device, then I also have a button on the title screen that toggles the value and closes the game to restart it. If you don't want to allow changing layout options on mobile devices, it would be cleaner to just use:

Code: Select all

if renpy.variant("mobile"):
        config.variants.append("small")
This forces all mobile devices to use the "small" screen variants, without changing the code of the individual screens.

As for checking to see what variants are active, I believe the variable to check is "config.variants". If you make a temporary label or line of dialogue that shows the value of that variable, you might get a better idea of what is different between the emulator and your phone.
Main Website
Includes information about and links to many of my current and past projects.

Major Game Projects
[Nightshade] Eldritch Academy, Eldritch University, Blooming Nightshade, Flowering Nightshade, Life as Designed
[Team Despair] Corpse Party D2 series

shiolily
Newbie
Posts: 18
Joined: Fri Aug 20, 2021 5:10 am
Deviantart: shiolily
Contact:

Re: Quick Menu in Android is tiny on hardware but not on Renpy Android Emulator

#7 Post by shiolily »

The broken textbox only happened on the android, not on desktop actually. Could the reverse be happening where it's pulling the desktop textbox image on mobile?

I tried your code again in case I got something wrong and it's still the same unfortunately, however I may have implemented it wrong.
This is what the top of the gui.rpy looks like:

Code: Select all

################################################################################
## Initialization
################################################################################

## The init offset statement causes the initialization statements in this file
## to run before init statements in any other file.
init offset = -2

## Calling gui.init resets the styles to sensible default values, and sets the
## width and height of the game.
init python:
    ## phones and tablets can change orientation
    if renpy.variant("mobile"):
        config.has_quicksave = False

        if persistent.mobile_layout == None: ## initial check on first time running the game
            if renpy.variant("small"):
                persistent.mobile_layout = "small"
            else:
                persistent.mobile_layout = "big"

        if persistent.mobile_layout == "small": ## mobile small variant
            config.variants.append("small")
        else: ## mobile big variant
            if renpy.variant("small"):
                config.variants.remove("small")

    ## renpy variant ### specific to my game, but the below is where the gui.init is in the default gui.rpy
    if renpy.variant("small"):
        gui.init(720,1280)
    else:
        gui.init(1280,720)

################################################################################
## GUI Configuration Variables
################################################################################
How would I go about making a button on the title screen that toggles the value?

Thank you so much for the help so far :D

shiolily
Newbie
Posts: 18
Joined: Fri Aug 20, 2021 5:10 am
Deviantart: shiolily
Contact:

Re: Quick Menu in Android is tiny on hardware but not on Renpy Android Emulator

#8 Post by shiolily »

Also: Tried making code to determine the variant. I'm a noob so obviously I got a bunch of errors. This is what I have:

Code: Select all

if renpy.variant = "tablet":
        "running tablet variant"
elif = "phone":
        "running phone variant"
elif = "large":
        "running large variant"
elif = "medium":
        "running medium variant"
elif = "small":
        "running small variant"
elif = "pc":
        "running pc variant"
And this is the traceback:

Code: Select all

I'm sorry, but an uncaught exception occurred.

While running game code:
  File "game/script.rpy", line 138, in script
    if renpy.variant = "tablet":
SyntaxError: invalid syntax (script.rpy, line 138)

-- Full Traceback ------------------------------------------------------------

Full traceback:
  File "game/script.rpy", line 138, in script
    if renpy.variant = "tablet":
  File "renpy/ast.py", line 1892, in execute
    if renpy.python.py_eval(condition):
  File "renpy/python.py", line 2247, in py_eval
    code = py_compile(code, 'eval')
  File "renpy/python.py", line 835, in py_compile
    raise e
SyntaxError: invalid syntax (script.rpy, line 138)

Windows-10-10.0.19041
Ren'Py 7.4.6.1693
The Rising Sun, Falling Waves 1.0
Sat Aug 21 19:42:48 2021
Any idea how to fix this/ do it properly?

Edit: Fixed it.

Code: Select all

if renpy.variant("tablet"):
    "running tablet variant"
elif renpy.variant("phone"):
    "running phone variant"
elif renpy.variant("large"):
    "running large variant"
elif renpy.variant("medium"):
    "running medium variant"
elif renpy.variant("small"):
    "running small variant"
elif renpy.variant("pc"):
    "running pc variant"
This could probably be done better but this is for anyone else that's fumbling around like me lol

User avatar
Jackkel Dragon
Veteran
Posts: 283
Joined: Mon Mar 31, 2014 7:17 pm
Organization: Nightshade, Team Despair
itch: jackkel-dragon
Location: USA
Contact:

Re: Quick Menu in Android is tiny on hardware but not on Renpy Android Emulator

#9 Post by Jackkel Dragon »

The issue with using the code as I gave it to you is that it doesn't solve the original problem (renpy.variant having "medium" instead of "small", most likely) on its own. The code in my previous post would be a better replacement if you just want all mobile devices to use the "small" variant, but I'll post some more code and details on the layout swapping.

First, we have the gui.rpy code from before, which needs to be in init python at level -2:

Code: Select all

## phones and tablets can change orientation
    if renpy.variant("mobile"):
        config.has_quicksave = False

        if persistent.mobile_layout == None:
            if renpy.variant("small"):
                persistent.mobile_layout = "small"
            else:
                persistent.mobile_layout = "big"

        if persistent.mobile_layout == "small":
            config.variants.append("small")
        else:
            if renpy.variant("small"):
                config.variants.remove("small")
What this code is doing:
- If we're on a mobile device, disable quicksaves.
- If we're on a mobile device and the layout is not set, we set the default to what Ren'Py thinks we are.
- If we're on a mobile device and the layout is set to small, force the game to use the "small" variant.Otherwise, make sure to remove the "small" variant.

(The gui.init should be whatever you want the base resolution to be. The stuff in the code from before is specific to my game, which has different orientations based on the layout selected.)

Next, I have a function defined in the screens.rpy, but as long as it's in an init python at level -1 it should work the same:

Code: Select all

init python:
    def toggle_layout():
        if (persistent.mobile_layout == "small"):
            persistent.mobile_layout = "big"
        else:
            persistent.mobile_layout = "small"
        renpy.quit(relaunch=True)
This mostly just toggles the layout value, then forces the game to restart. (Styles don't refresh well mid-game, so restarting is how we clear styles here.)

Then, within the screens.rpy definition for the main_menu screen, I have this:

Code: Select all

    style_prefix "main_menu"
    ## above is mostly default
	
    if renpy.variant("mobile"):
        button:
            if (persistent.mobile_layout == "big"):
                xsize 100 ysize 100
                align (1.00,0.0)
                text "↕" align (0.5, 0.5) style "main_menu_button_text" size 75
            else:
                xsize 75 ysize 75
                align (0.5,0.91)
                text "↔" align (0.5, 0.5) style "main_menu_button_text" size 75
            action Confirm(_("Change the game layout?\nThis will close the game, and may require several restarts."), Function(toggle_layout, _update_screens=True))
            
     ## continue to navigation buttons and such
What this code does is add a button to the menu if we're playing on a mobile device. I made it different based on the current layout, but you can probably put it in one place if the actual layout doesn't change much. (For me, portrait <-> landscape meant I needed to move it a bit for each variant.) The "Confirm" action basically prompts the player using the text given as a warning before they accept, then only runs the toggle function if they agree. The button text and confirm text may need to be altered for your purposes, since this is directly from my game (where, again, the layout is pretty different between the two versions).

So, that's the way I've handled the issue with phones that count as "medium" devices in Ren'Py. And as I mentioned before, my previous post has the simpler option that forces medium phones and tablets to use the small phone variants. Hopefully one of these options helps in figuring out what to do here.

Edit: For the variants check, the issue is that you seem to be using the function as if it were the variable. To elaborate:

renpy.variant(string) - This returns "True" if the string given is in the variant list, or otherwise returns False. Example:

Code: Select all

if (renpy.variant("small")): ## or if (renpy.variant("small") == True)
	pass ## blank code
config.variants (where the variants are actually stored) is a Python list, which means equality checks (==) with strings won't work. Instead, you'd have to do something like:

Code: Select all

if "small" in config.variants:
	$ someVar = "small"
(If you simply typed config.variants into the console, you'd get a list notation, such as: ["small", "mobile", "touch"] or something like that.)

Personally, I'd probably use a screen text/label to check the variants on the phone before just removing the text element, but for now here are two less coding-intensive ways:

Code: Select all

label variantcheck: ## making a renpy label
	$ listver = str(config.variants) ## string of the list of variants
	"Variants are: [listver]"
	
	for v in config.variants: ## for loop through the variant list, then output them line-by-line
		"Running [v] variant"
After you have this, just call or jump to it. Let me know if it doesn't work... I only tested the first one fully.
Main Website
Includes information about and links to many of my current and past projects.

Major Game Projects
[Nightshade] Eldritch Academy, Eldritch University, Blooming Nightshade, Flowering Nightshade, Life as Designed
[Team Despair] Corpse Party D2 series

shiolily
Newbie
Posts: 18
Joined: Fri Aug 20, 2021 5:10 am
Deviantart: shiolily
Contact:

Re: Quick Menu in Android is tiny on hardware but not on Renpy Android Emulator

#10 Post by shiolily »

I tried your code for the switching. It's functional! There's just one problem, the button is totally invisible (or behind something) so I kept pressing the screen randomly until it picked it up. Also, once the game is in phone mode there's no way to switch back to tablet mode. Pressing in the same spot doesn't let me switch back, and I tried pressing everywhere on the screen. I have to clear the game data to switch back.

As for the variants check, right before you replied I figured out a clunky solution:

Code: Select all

if renpy.variant("tablet"):
    "running tablet variant"
elif renpy.variant("phone"):
    "running phone variant"
elif renpy.variant("large"):
    "running large variant"
elif renpy.variant("medium"):
    "running medium variant"
elif renpy.variant("small"):
    "running small variant"
elif renpy.variant("pc"):
    "running pc variant"
which proved that the game was running in tablet mode.
https://media.discordapp.net/attachment ... 201541.png

I tried the code you put regardless, but since I'm a noob I have no idea where to put them and I got various errors, stuff like 'tab characters not allowed in renpy script' or 'indentation mismatch'. I tried putting it in the console too but that also failed.

User avatar
Jackkel Dragon
Veteran
Posts: 283
Joined: Mon Mar 31, 2014 7:17 pm
Organization: Nightshade, Team Despair
itch: jackkel-dragon
Location: USA
Contact:

Re: Quick Menu in Android is tiny on hardware but not on Renpy Android Emulator

#11 Post by Jackkel Dragon »

In the button code, the align values are different between the two layouts. (Align is a tuple in the form (x,y)) In big mode, it's in the top-right. In small mode, it's in the bottom middle. That's one of the parts you may want to change for your own game, specifically you may want to make it the same location no matter what layout is active.

As for it not appearing, what font does your game use? If it doesn't have those arrow characters in it, then they won't display or will show up as boxes. That's why I recommend changing the button text for your purposes. An example change:

Code: Select all

if renpy.variant("mobile"):
        button:
            xsize 100 ysize 100
            align (1.00,0.0)
            text "Swap Screen Variants" align (0.5, 0.5) style "main_menu_button_text" size 75
            action Confirm(_("Change the game layout?\nThis will close the game, and may require several restarts."), Function(toggle_layout, _update_screens=True))
As for indentation mismatches on my sample code, I wrote some of that directly into the text editor on this forum, so it may have mixed tab and space characters. Python doesn't like that; you need to either use all tabs or all spaces for indentation. The main text editor I use for code has a feature to display whitespace characters, which can be useful to clean up stuff like that. (Most of the default Ren'Py code uses 4 spaces as its indentation, so I try to stick to that.) If you replace the tabs with spaces and/or type out those lines yourself, they should work at least enough to stop throwing errors.

Regarding your code, one thing I want to note is that using "elif" in this case doesn't show all the possible variants, since Ren'Py tracks multiple variants at a time. For instance, most phones have ["mobile", "touch", "small"] as the variant list. The way you coded it, it will only show the first thing it finds. In this case it told us what we wanted to know, but something to keep in mind for other list-type objects.

As a side note, since more complicated Ren'Py stuff involves a lot of Python or Python-esque coding, I'd recommend a site like this: https://www.w3schools.com/PYTHON/
This particular site has a built-in interpreter that lets you try out different things with Python, even without installing it on your device. It was one of the places I used to learn the basics of Python, and it's still useful as a reference. (The Ren'Py and Python documentation are also great, but don't always have simple examples.)

Let me know if the sample code still doesn't work or help after fixing the tabs... I'll have to do some more tests if the code itself doesn't work. Hopefully changing the button text and location will get most of the job done, though.
Main Website
Includes information about and links to many of my current and past projects.

Major Game Projects
[Nightshade] Eldritch Academy, Eldritch University, Blooming Nightshade, Flowering Nightshade, Life as Designed
[Team Despair] Corpse Party D2 series

shiolily
Newbie
Posts: 18
Joined: Fri Aug 20, 2021 5:10 am
Deviantart: shiolily
Contact:

Re: Quick Menu in Android is tiny on hardware but not on Renpy Android Emulator

#12 Post by shiolily »

I actually figured it was the font that might be an issue so I put in a font tag

Code: Select all

{font="fonts/myfont.ttf"}{/font}
which works in other parts of the game. I double checked that the font had those characters, and also changed the character to ones I knew were present in my font, like AAAA or 'press to change layout' etc. Still no dice, then I remembered I turned off the renpy default game name because my game logo is baked into the background. I thought that could be causing the button to be hidden, so I set define gui.show_name = True. It showed the name but not the button, so I changed it back to False.

However, I am able to switch between the tablet and phone versions, the button is just invisible.

https://media.discordapp.net/attachment ... eight=1338



My elif code: I knew it was bad from the start because I've done some simple stuff for a highschool class but I wasn't experienced enough to come up with something better lol, I wasn't exactly sure where to look either. I'll try your code again :D And thank you for the link, I'm checking it out right now :D

I retyped the code. This is what happened.

Code: Select all

if (renpy.variant("small")):
    pass

if (renpy.variant("small") == True):
    pass
it worked! pass is blank code so I just replaced it with "test" and it showed up on the mobile emulator.

Code: Select all

if "small" in config.variants:
    $ someVar = "small"
nothing happened, perhaps I put it in wrong. I also tried typing it into the console, and it just said 'expected statement'. I then put it in the game script again and tried to watch the someVar variable but I'm unsure if that was the right thing to do.

Then I tried this code.

Code: Select all

label variantcheck: ##making a renpy label
    $ listver = str(config.variants) ## string of the list of variants
    "Variants are: [listver]"

    for v in config.variants: ## for loop through the variant list, then output them line-by-line
        "Running [v] variant"
result:

Code: Select all

I'm sorry, but errors were detected in your script. Please correct the
errors listed below, and try again.


File "game/script.rpy", line 143: expected statement.
    for [v] in config.variants: 
            ^

Ren'Py Version: Ren'Py 7.4.6.1693
Sun Aug 22 18:42:41 2021

User avatar
Jackkel Dragon
Veteran
Posts: 283
Joined: Mon Mar 31, 2014 7:17 pm
Organization: Nightshade, Team Despair
itch: jackkel-dragon
Location: USA
Contact:

Re: Quick Menu in Android is tiny on hardware but not on Renpy Android Emulator

#13 Post by Jackkel Dragon »

Minor things first; the example code with "someVar" is basically just setting a variable if that condition is true. Your use of "renpy.variant("small")" is pretty much the same thing as that conditional in the end, so that one has served its purpose.

As for the for loop, I went and tested it myself and got errors as well. I suppose Ren'Py doesn't like using an iterating variable when creating dialogue, which is good to know...

Now for the potentially bigger issue: what exactly did you make your button code look like, and where are you tapping to get it to work? Depending on the position/align/anchor values, maybe the text is off the screen or isn't being applied to the button.
Main Website
Includes information about and links to many of my current and past projects.

Major Game Projects
[Nightshade] Eldritch Academy, Eldritch University, Blooming Nightshade, Flowering Nightshade, Life as Designed
[Team Despair] Corpse Party D2 series

shiolily
Newbie
Posts: 18
Joined: Fri Aug 20, 2021 5:10 am
Deviantart: shiolily
Contact:

Re: Quick Menu in Android is tiny on hardware but not on Renpy Android Emulator

#14 Post by shiolily »

edit: my latest replies aren't always showing up when I view this thread, idk why /:

here's a copy of the text in case others can't see it

You're exactly right, that fixed the button! You have the patience of a saint aaaaa ;; thank you so much!!

https://media.discordapp.net/attachment ... eight=1338

end result (tweaked the location values somewhat)

Code: Select all

add gui.main_menu_background
this line of code was the one I misplaced lol

Code: Select all

    if renpy.variant("mobile"):
        button:
            if (persistent.mobile_layout == "big"):
                xsize 100 ysize 100
                align (0.95,0.1)
                text "Change Layout to Phone" align (1.5, 0.5) style "main_menu_button_text" size 25
            else:
                xsize 75 ysize 75
                align (0.95,0.1)
                text "Change Layout to Tablet" align (1.5, 0.5) style "main_menu_button_text" size 25
            action Confirm(_("Change the game layout?\nThis will close the game, and may require several restarts."), Function(toggle_layout, _update_screens=True))


tweaked values so the button wasn't at the edge of the screen d:

Once again thank you so much!!

------------

The button code is almost identical to yours. Pretty much the only thing changed is the arrow symbol, and the tablet and phone buttons being in the same location. It doesn't matter what I change the button text to, it doesn't show up D: I played around with the locations and even replaced the align with xpos and ypos to make the text smack in the middle of the screen and it didn't work.

Game is running at 1280x720

Code: Select all

screen main_menu():

    ## This ensures that any other menu screen is replaced.
    tag menu

    style_prefix "main_menu"
    ## above is mostly default textbutton _("Help") action ShowMenu("help")

    if renpy.variant("mobile"):
        button:
            if (persistent.mobile_layout == "big"):
                xsize 100 ysize 100
                align (1.00,0.0)
                text "Change Layout to Phone" align (0.5, 0.5) style "main_menu_button_text" size 75
            else:
                xsize 75 ysize 75
                align (1.00,0.0)
                text "Change Layout to Tablet" align (0.5, 0.5) style "main_menu_button_text" size 75
            action Confirm(_("Change the game layout?\nThis will close the game, and may require several restarts."), Function(toggle_layout, _update_screens=True))

     ## continue to navigation buttons and such

    add gui.main_menu_background
I click in the top right corner and it switches the layout.

https://img.guildedcdn.com/ContentMedia ... 560&h=1336

Here's a video of the screen (in the renpy mobile emulator) and me clicking it. It works, it's just strangely invisible.
Last edited by shiolily on Tue Aug 24, 2021 7:38 pm, edited 1 time in total.

User avatar
Jackkel Dragon
Veteran
Posts: 283
Joined: Mon Mar 31, 2014 7:17 pm
Organization: Nightshade, Team Despair
itch: jackkel-dragon
Location: USA
Contact:

Re: Quick Menu in Android is tiny on hardware but not on Renpy Android Emulator

#15 Post by Jackkel Dragon »

Okay, I think I might see the issue. The code you posted is drawing the button before the background, so the background is being placed on top of it. Try putting the background code before the button and see if that helps.
Main Website
Includes information about and links to many of my current and past projects.

Major Game Projects
[Nightshade] Eldritch Academy, Eldritch University, Blooming Nightshade, Flowering Nightshade, Life as Designed
[Team Despair] Corpse Party D2 series

Post Reply

Who is online

Users browsing this forum: Google [Bot]