[SOLVED]Quick Menu with images.

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
johandark
Veteran
Posts: 346
Joined: Sat Apr 30, 2016 11:04 am
Completed: Wild Guards, In Dreams
Projects: Pact with a witch
Deviantart: johandarkweb
Location: Barcelona
Contact:

[SOLVED]Quick Menu with images.

#1 Post by johandark » Wed Jul 27, 2016 4:12 am

My quickmenu:

Code: Select all

##############################################################################
# Quick Menu
#
# A screen that's included by the default say screen, and adds quick access to
# several useful functions.
screen quick_menu():

    # Add an in-game quick menu.
    vbox:
        style_group "quick"

        xalign 1.0
        yalign 1.0
        
        
        textbutton _("Atrás")  action Rollback()
        textbutton _("Omitir") action Skip()
        #textbutton _("Omitir R.") action Skip(fast=True, confirm=True)
        #textbutton _("Auto") action Preference("auto-forward", "toggle")
        #textbutton _("Guardar") action ShowMenu('save')
        textbutton _("Guardado R.") action QuickSave()
        textbutton _("Cargado R.") action QuickLoad()

        textbutton _("Opciones") action ShowMenu('preferences')

init -2:
    style quick_button:
        is default
        background None
        ypadding 2

    style quick_button_text:
        is default
        size 15
        idle_color "#8888"
        hover_color "#fff"
        selected_idle_color "#cc08"
        selected_hover_color "#ff0"
        insensitive_color "#4448"
What I would like is something like this:
example02.jpg
example02.jpg (14.75 KiB) Viewed 363 times
Where textbuttons like "Back" or "Quick Save" or "Quick Load" are images instead of just text.

So i´ve tried this code:

Code: Select all

        textbutton _("Atrás") hover "back_hover.png" idle "back_idle.png" action Rollback()
Obviously I´ve failed...

How can I do it?

(Just the in-game menu, I don´t want it in the Main Menu or Preferences Menu).

Thanks!
Attachments
example01.jpg
Last edited by johandark on Wed Jul 27, 2016 5:34 am, edited 1 time in total.
Image

User avatar
xavimat
Eileen-Class Veteran
Posts: 1458
Joined: Sat Feb 25, 2012 8:45 pm
Completed: Yeshua, Jesus Life, Cops&Robbers
Projects: Fear&Love, unknown
Organization: Pilgrim Creations
Github: xavi-mat
itch: pilgrimcreations
Location: Spain
Contact:

Re: Quick Menu with images.

#2 Post by xavimat » Wed Jul 27, 2016 5:18 am

Change the textbuttons with imagebuttons
Comunidad Ren'Py en español: ¡Únete a nuestro Discord!
Rhaier Kingdom A Ren'Py Multiplayer Adventure Visual Novel.
Cops&Robbers A two-player experiment | Fear&Love Why can't we say I love you?
Honest Critique (Avatar made with Chibi Maker by ~gen8)

User avatar
johandark
Veteran
Posts: 346
Joined: Sat Apr 30, 2016 11:04 am
Completed: Wild Guards, In Dreams
Projects: Pact with a witch
Deviantart: johandarkweb
Location: Barcelona
Contact:

Re: Quick Menu with images.

#3 Post by johandark » Wed Jul 27, 2016 5:21 am

How? Cand you show me a simple example?
Image

User avatar
xavimat
Eileen-Class Veteran
Posts: 1458
Joined: Sat Feb 25, 2012 8:45 pm
Completed: Yeshua, Jesus Life, Cops&Robbers
Projects: Fear&Love, unknown
Organization: Pilgrim Creations
Github: xavi-mat
itch: pilgrimcreations
Location: Spain
Contact:

Re: Quick Menu with images.

#4 Post by xavimat » Wed Jul 27, 2016 5:29 am

There is a very good example in the cookbook about imagebuttons.
Put:
imagebutton idle "idleatras.png" hover "hoveratras.png" action Rollback()
Comunidad Ren'Py en español: ¡Únete a nuestro Discord!
Rhaier Kingdom A Ren'Py Multiplayer Adventure Visual Novel.
Cops&Robbers A two-player experiment | Fear&Love Why can't we say I love you?
Honest Critique (Avatar made with Chibi Maker by ~gen8)

User avatar
johandark
Veteran
Posts: 346
Joined: Sat Apr 30, 2016 11:04 am
Completed: Wild Guards, In Dreams
Projects: Pact with a witch
Deviantart: johandarkweb
Location: Barcelona
Contact:

Re: Quick Menu with images.

#5 Post by johandark » Wed Jul 27, 2016 5:33 am

I knew it had to be simple!

Thanks!!!
Image

Post Reply

Who is online

Users browsing this forum: Bing [Bot]