[SOLVED]Using icons in quick menu instead of text and changing border at the same time...

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
AnnieJuraski
Newbie
Posts: 7
Joined: Thu Mar 14, 2024 7:56 pm
Contact:

[SOLVED]Using icons in quick menu instead of text and changing border at the same time...

#1 Post by AnnieJuraski »

I watched a video where a guy explained how to add icons in quick menu instead of text. So I created a rpy file, name quickmenu.rpy, with this code:

Code: Select all

init:
    transform buttonZoom:
        zoom 0.06


#backbutton
##################################

image backidle:
    "gui/quickmenu/back.png"
    
image  backhover:
    "gui/quickmenu/back.png"
    matrixcolor TintMatrix("#ffffff")
    ease 0.5 matrixcolor TintMatrix("#bd0000")
    easeout 0.5 matrixcolor TintMatrix("#ffffff")
    repeat

image inactiveback:
    "gui/quickmenu/back.png"
    alpha 0.5

#history 
##################################

image historyidle:
    "gui/quickmenu/history.png"
    
image  historyhover:
    "gui/quickmenu/history.png"
    matrixcolor TintMatrix("#ffffff")
    ease 0.5 matrixcolor TintMatrix("#bd0000")
    easeout 0.5 matrixcolor TintMatrix("#ffffff")
    repeat

image historyinactive:
    "gui/quickmenu/history.png"
    alpha 0.5   



   
init 100:
    screen quick_menu():
        zorder 100
        

        

        if quick_menu:                        

            vbox:
                style_prefix "quick"

                $ tooltip = GetTooltip()

                if tooltip:
                    text "[tooltip]"
            

                
                xalign 0.01
                yalign 1.0

                imagebutton:
                    idle "backidle" 
                    hover "backhover"
                    insensitive "inactiveback"
                    tooltip "Voltar"
                    at buttonZoom
                    action Rollback()
                    

                imagebutton:
                    idle "historyidle" 
                    hover "historyhover"
                    insensitive "historyinactive"
                    tooltip "Voltar"
                    at buttonZoom
                    action  ShowMenu('history')
                    
                
                textbutton _("Pular") action Skip() alternate Skip(fast=True, confirm=True)
                textbutton _("Automotivo") action Preference("auto-forward", "toggle")
                textbutton _("Salvar") action ShowMenu('save')
                textbutton _("Q.Salvar") action QuickSave()
                textbutton _("Q.Caregar") action QuickLoad()
                    



            
It works to change icons, but even if I put that same code inside screens.rpy and change borders in gui.quick_button_borders = Borders, the icons still close to each other, but the "textbuttons" that I haven't changed yet keep ther border change.
How to add spacing between them?
Maybe there is a better way to use icons insted of text than this one?
ALso, there is a way to add background image to quick menu?
Last edited by AnnieJuraski on Mon Mar 18, 2024 5:36 pm, edited 1 time in total.

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

Re: Using icons in quick menu instead of text and changing border at the same time...

#2 Post by Imperf3kt »

Borders are a different property than what you want, you're looking for some spacing between the textbuttons

Code: Select all


        if quick_menu:                        

            vbox:
                style_prefix "quick"

                $ tooltip = GetTooltip()

                if tooltip:
                    text "[tooltip]"
            

                
                xalign 0.01
                yalign 1.0
                spacing 25 #adjust this number to increase or decrease distance between menu items
                
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

AnnieJuraski
Newbie
Posts: 7
Joined: Thu Mar 14, 2024 7:56 pm
Contact:

Re: Using icons in quick menu instead of text and changing border at the same time...

#3 Post by AnnieJuraski »

Imperf3kt wrote: Thu Mar 14, 2024 8:48 pm Borders are a different property than what you want, you're looking for some spacing between the textbuttons

Code: Select all


        if quick_menu:                        

            vbox:
                style_prefix "quick"

                $ tooltip = GetTooltip()

                if tooltip:
                    text "[tooltip]"
            

                
                xalign 0.01
                yalign 1.0
                spacing 25 #adjust this number to increase or decrease distance between menu items
                
Thx, it worked

Post Reply

Who is online

Users browsing this forum: Syrale