Android - hiding quick menu and font size

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
mameshiba
Newbie
Posts: 20
Joined: Fri Jan 19, 2018 6:10 pm
Contact:

Android - hiding quick menu and font size

#1 Post by mameshiba »

Hi lemmasoft
I'm a newbie to renpy and I'm having loads of fun learning. I'm trying to make my game for Android devices, and ive got two questions which I can't quite solve.
When I have an in-game menu, the font size is very small. I can't find the specific mention in the GUI file for this for Android.
The second thing I want to do is hide the quick menu are the bottom. When I hide this in the GUI file, this doesn't impact android. Any ideas?
Image with example here: https://imgur.com/a/KLVEEVc
Thanks for your help!

User avatar
ComputerArt.Club
Veteran
Posts: 427
Joined: Mon May 22, 2017 8:12 am
Completed: Famous Fables, BoPoMoFo: Learn Chinese, Santa's workshop, Cat's Bath, Computer Art Club
Location: Taiwan
Contact:

Re: Android - hiding quick menu and font size

#2 Post by ComputerArt.Club »

Two problems: Comment lines 242 to 282 of screens.rpy to hide the quick menu in the PC version of the game (you could also delete them, but I usually leave them in there in case I want to bring them back and so I can keep track of line numbers) and comment lines 1370 to 1472 to get rid of the default android/mobile alterations (so now your PC version is your Android version).
Lines 242 to 282 commented

Code: Select all

## Quick Menu screen ###########################################################
##
## The quick menu is displayed in-game to provide easy access to the out-of-game
## menus.

# screen quick_menu():

    # ## Ensure this appears on top of other screens.
    # zorder 100

    # if quick_menu:

        # hbox:
            # style_prefix "quick"

            # xalign 0.5
            # yalign 1.0

            # textbutton _("Back") action Rollback()
            # textbutton _("History") action ShowMenu('history')
            # textbutton _("Skip") action Skip() alternate Skip(fast=True, confirm=True)
            # textbutton _("Auto") action Preference("auto-forward", "toggle")
            # textbutton _("Save") action ShowMenu('save')
            # textbutton _("Q.Save") action QuickSave()
            # textbutton _("Q.Load") action QuickLoad()
            # textbutton _("Prefs") action ShowMenu('preferences')


# ## This code ensures that the quick_menu screen is displayed in-game, whenever
# ## the player has not explicitly hidden the interface.
# init python:
    # config.overlay_screens.append("quick_menu")

# default quick_menu = True

# style quick_button is default
# style quick_button_text is button_text

# style quick_button:
    # properties gui.button_properties("quick_button")

# style quick_button_text:
    # properties gui.button_text_properties("quick_button")
Lines 1367 1472 (commented):
################################################################################
## Mobile Variants
################################################################################

Code: Select all

# style pref_vbox:
    # variant "medium"
    # xsize 380

# ## Since a mouse may not be present, we replace the quick menu with a version
# ## that uses fewer and bigger buttons that are easier to touch.
# screen quick_menu():
    # variant "touch"

    # zorder 100

    # hbox:
        # style_prefix "quick"

        # xalign 0.5
        # yalign 1.0

        # textbutton _("Back") action Rollback()
        # textbutton _("Skip") action Skip() alternate Skip(fast=True, confirm=True)
        # textbutton _("Auto") action Preference("auto-forward", "toggle")
        # textbutton _("Menu") action ShowMenu()


# style window:
    # variant "small"
    # background "gui/phone/textbox.png"

# style radio_button:
    # variant "small"
    # foreground "gui/phone/button/check_[prefix_]foreground.png"

# style check_button:
    # variant "small"
    # foreground "gui/phone/button/check_[prefix_]foreground.png"

# style nvl_window:
    # variant "small"
    # background "gui/phone/nvl.png"

# style main_menu_frame:
    # variant "small"
    # background "gui/phone/overlay/main_menu.png"

# style game_menu_outer_frame:
    # variant "small"
    # background "gui/phone/overlay/game_menu.png"

# style game_menu_navigation_frame:
    # variant "small"
    # xsize 287

# style game_menu_content_frame:
    # variant "small"
    # top_margin 0

# style pref_vbox:
    # variant "small"
    # xsize 338

# style bar:
    # variant "small"
    # ysize gui.bar_size
    # left_bar Frame("gui/phone/bar/left.png", gui.bar_borders, tile=gui.bar_tile)
    # right_bar Frame("gui/phone/bar/right.png", gui.bar_borders, tile=gui.bar_tile)

# style vbar:
    # variant "small"
    # xsize gui.bar_size
    # top_bar Frame("gui/phone/bar/top.png", gui.vbar_borders, tile=gui.bar_tile)
    # bottom_bar Frame("gui/phone/bar/bottom.png", gui.vbar_borders, tile=gui.bar_tile)

# style scrollbar:
    # variant "small"
    # ysize gui.scrollbar_size
    # base_bar Frame("gui/phone/scrollbar/horizontal_[prefix_]bar.png", gui.scrollbar_borders, tile=gui.scrollbar_tile)
    # thumb Frame("gui/phone/scrollbar/horizontal_[prefix_]thumb.png", gui.scrollbar_borders, tile=gui.scrollbar_tile)

# style vscrollbar:
    # variant "small"
    # xsize gui.scrollbar_size
    # base_bar Frame("gui/phone/scrollbar/vertical_[prefix_]bar.png", gui.vscrollbar_borders, tile=gui.scrollbar_tile)
    # thumb Frame("gui/phone/scrollbar/vertical_[prefix_]thumb.png", gui.vscrollbar_borders, tile=gui.scrollbar_tile)

# style slider:
    # variant "small"
    # ysize gui.slider_size
    # base_bar Frame("gui/phone/slider/horizontal_[prefix_]bar.png", gui.slider_borders, tile=gui.slider_tile)
    # thumb "gui/phone/slider/horizontal_[prefix_]thumb.png"

# style vslider:
    # variant "small"
    # xsize gui.slider_size
    # base_bar Frame("gui/phone/slider/vertical_[prefix_]bar.png", gui.vslider_borders, tile=gui.slider_tile)
    # thumb "gui/phone/slider/vertical_[prefix_]thumb.png"

# style slider_pref_vbox:
    # variant "small"
    # xsize None

# style slider_pref_slider:
    # variant "small"
    # xsize 507
This is what I think I usually do as my games are usually Android only, I want all my default code to be what I see on Android. It is a rather clumsy method and there are probably better ways of doing it.
This should also help you get around the text sizes issues you were having. Anything that you change in the GUI file should also affect the android after commenting that, I think.

Alternatively, you could just alter that mobile section and test your game through Android -> Emulation -> Phone instead of using the default "launch project" method.

Others might have better suggestions though.

mameshiba
Newbie
Posts: 20
Joined: Fri Jan 19, 2018 6:10 pm
Contact:

Re: Android - hiding quick menu and font size

#3 Post by mameshiba »

Awesome - I'll give it a go! Great idea make Android settings the default.

If you've been making renpy for Android, have you come across this '"From November 2018, app updates must target Android 8.0 (API level 26)." from the GooglePlay store? I'm trying to set up an internal test and I just don't know what in my RenPy I would update.

User avatar
ComputerArt.Club
Veteran
Posts: 427
Joined: Mon May 22, 2017 8:12 am
Completed: Famous Fables, BoPoMoFo: Learn Chinese, Santa's workshop, Cat's Bath, Computer Art Club
Location: Taiwan
Contact:

Re: Android - hiding quick menu and font size

#4 Post by ComputerArt.Club »

Well, it has worked for me so far anyway, and that is the way I would like it to appear on a PC too anyway, but then again, my games are directed at children so the text should be larger anyway.

There was a thread on that API issue recently: viewtopic.php?f=32&t=50054
Imperf3kt wrote: Thu May 10, 2018 5:16 pm Pytom is aware of the requirement and has replied that it will by the time it needs to be.
viewtopic.php?f=32&t=13987&start=240#p477315

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

Re: Android - hiding quick menu and font size

#5 Post by Imperf3kt »

mameshiba wrote: Sat May 19, 2018 9:35 am Awesome - I'll give it a go! Great idea make Android settings the default.

If you've been making renpy for Android, have you come across this '"From November 2018, app updates must target Android 8.0 (API level 26)." from the GooglePlay store? I'm trying to set up an internal test and I just don't know what in my RenPy I would update.
You don't update anything. PyTom will get the level 8 API from Google when he has time in his schedule, and put it into Ren'Py itself. Only thing you'll need to do is update the android SDK etc when that change takes place.
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

mameshiba
Newbie
Posts: 20
Joined: Fri Jan 19, 2018 6:10 pm
Contact:

Re: Android - hiding quick menu and font size

#6 Post by mameshiba »

Imperf3kt wrote: Sat May 19, 2018 6:21 pm You don't update anything. PyTom will get the level 8 API from Google when he has time in his schedule, and put it into Ren'Py itself. Only thing you'll need to do is update the android SDK etc when that change takes place.
Awesome! I'll just wait, then.

I'm trying to do an internal test of my current VN on Google Play, but it doesn't seem to be let me launch an internal test until I update the API. I might just need to do some more research to see if there's another way I can give external testers access. Thanks! :)

User avatar
PyTom
Ren'Py Creator
Posts: 16088
Joined: Mon Feb 02, 2004 10:58 am
Completed: Moonlight Walks
Projects: Ren'Py
IRC Nick: renpytom
Github: renpytom
itch: renpytom
Location: Kings Park, NY
Contact:

Re: Android - hiding quick menu and font size

#7 Post by PyTom »

The android update is the first thing on my plate after 7.0 is out. Unfortunately, it looks like it's going to be a bit less convenient to use than it was before, due to the changes in the way google did things. I'll be doing my best to mitigate that.
Supporting creators since 2004
(When was the last time you backed up your game?)
"Do good work." - Virgil Ivan "Gus" Grissom
Software > Drama • https://www.patreon.com/renpytom

dotHack
Newbie
Posts: 9
Joined: Sun Apr 30, 2023 12:55 am
Contact:

Re: Android - hiding quick menu and font size

#8 Post by dotHack »

ComputerArt.Club wrote: Sun May 13, 2018 10:09 am [...]and comment lines 1370 to 1472 to get rid of the default android/mobile alterations (so now your PC version is your Android version).
Did this help you solving the interface font size?
No matter what I do, I can never change the font size of my main/game menu. It works for dialog text, though.

First, I tried to change the font size for mobile version, manually. Didn't work. Now, I commented out the lines you mentioned such that my PC version became my mobile version. Playing around with these variables in gui.rpy did not help changing the font size either:

Code: Select all

## Fonts and Font Sizes ########################################################

## The font used for in-game ext.
define gui.text_font = "gui/Mali-Medium.ttf"

## The font used for character names.
define gui.name_text_font = "gui/Mali-SemiBold.ttf"

## The font used for out-of-game text.
define gui.interface_text_font = "gui/Mali-Regular.ttf"

## The size of normal dialogue text.
define gui.text_size = 60

## The size of character names.
define gui.name_text_size = 60

## The size of text in the game's user interface.
define gui.interface_text_size = 150
    

## The size of labels in the game's user interface.
define gui.label_text_size = 100

## The size of text on the notify screen.
define gui.notify_text_size = 40

## The size of the game's title.
define gui.title_text_size = 66

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

Re: Android - hiding quick menu and font size

#9 Post by Imperf3kt »

Scroll to the bottom of gui.rpy, you'll find an entire section for mobile variants that overrides all of those settings.
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

dotHack
Newbie
Posts: 9
Joined: Sun Apr 30, 2023 12:55 am
Contact:

Re: Android - hiding quick menu and font size

#10 Post by dotHack »

Yes, I noticed them before. But, I did not know I had to change the button_text_size instead of the interface_text_size O.O.
Thanks @Imperf3kt, you helped me realizing it.

Post Reply

Who is online

Users browsing this forum: Kocker, ZianRiyone