how to space quick menu image buttons?

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
User avatar
Cubaris
Newbie
Posts: 16
Joined: Mon Apr 27, 2020 10:39 pm
Projects: Crescent Moon Bay, A Trip To The Park
Tumblr: CubarisMurina
itch: Cubaris
Location: California
Contact:

how to space quick menu image buttons?

#1 Post by Cubaris »

currently struggling with how to space quick menu buttons since this is my first time tampering with them </3 i tried to mess with this code in gui.rpy

Code: Select all

define gui.quick_button_borders = Borders(15, 6, 15, 0)
but i didn't see any effect on the buttons.

here's how it looks at the moment.
Image

and this is how i have the buttons set up (ignore the idle and hover being the same image LOL)

Code: Select all

if quick_menu:

        hbox:
            style_prefix "quick"

            xalign 0.5
            yalign 0.995

            imagebutton idle ("/gui/button/back.png") hover ("/gui/button/back.png") action Rollback()
            imagebutton idle ("/gui/button/log.png") hover ("/gui/button/log.png") action ShowMenu('history')
            imagebutton idle ("/gui/button/skip.png") hover ("/gui/button/skip.png") action Skip() alternate Skip(fast=True, confirm=True)
            imagebutton idle ("/gui/button/auto.png") hover ("/gui/button/auto.png") action Preference("auto-forward", "toggle")
            imagebutton idle ("/gui/button/save.png") hover ("/gui/button/save.png") action ShowMenu('save')
            imagebutton idle ("/gui/button/load.png") hover ("/gui/button/load.png") action ShowMenu('load')
            imagebutton idle ("/gui/button/menu.png") hover ("/gui/button/menu.png") action ShowMenu('preferences')
Image
hi im azrael, have my oc cas as a dog
[he/they]

User avatar
plastiekk
Regular
Posts: 112
Joined: Wed Sep 29, 2021 4:08 am
Contact:

Re: how to space quick menu image buttons?

#2 Post by plastiekk »

Cubaris wrote: Thu Sep 14, 2023 7:26 pm ...
Should work with a grid.
Try:

Code: Select all

if quick_menu:

        hbox:
            style_prefix "quick"

            xalign 0.5
            yalign 0.995

            grid 7 1:        # 7 buttons, 1 row
                spacing 10   # adjust to the spacing you want.
                
                imagebutton idle ("/gui/button/back.png") hover ("/gui/button/back.png") action Rollback()
                imagebutton idle ("/gui/button/log.png") hover ("/gui/button/log.png") action ShowMenu('history')
                imagebutton idle ("/gui/button/skip.png") hover ("/gui/button/skip.png") action Skip() alternate Skip(fast=True, confirm=True)
                imagebutton idle ("/gui/button/auto.png") hover ("/gui/button/auto.png") action Preference("auto-forward", "toggle")
                imagebutton idle ("/gui/button/save.png") hover ("/gui/button/save.png") action ShowMenu('save')
                imagebutton idle ("/gui/button/load.png") hover ("/gui/button/load.png") action ShowMenu('load')
                imagebutton idle ("/gui/button/menu.png") hover ("/gui/button/menu.png") action ShowMenu('preferences')
Why on earth did I put the bread in the fridge?

Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot]