Help with quick menu, custom buttons image

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
eesy
Regular
Posts: 39
Joined: Mon May 14, 2012 3:30 am
Contact:

Help with quick menu, custom buttons image

#1 Post by eesy » Mon Jun 04, 2012 12:40 pm

Hello I'm really stuck.. i've read several thread but I still can't seem to figure out what to do at all ><; I need a detailed information.. I'm a noob sorry!

1. I already have the customized textbox in the game, but I want to have a checklist, A journal , and a phone button appears next to the textbox. I know I'm supposed to create a screen, but how? I want to make the phone works like part of a menu.. so there won't be any difficult interface. I just want a button that will jump to some label, a label that will have kinda like "Who do you want to call? menu:-a -b -c < and then jump to label of the person called.. so everytime she called, she will have different conversations. So for example, after the script reaches a certain label, is its possible too to change the button link? so at label day1, the phone would lead to label phoneday1 , that will only have 1 contact, and not much conversation. then label day2, the phone button will lead to label phoneday2 which will have more contacts to choose, and from that contacts will have more questions to be asked. http://www.youtube.com/watch?v=77HAwy9IJ_o << kinda like that.

2. To make the quick menus appearing below the textbox, what do I have to add? Do I look in screens.rpy? How to add imagebutton?
3. What code to use to add the inventory button next to the quick menus? Is there a limit to how many custom buttons/new screens I can make? And how to limit the inventory to 10?
4. Is it possible to make the gallery room in the game and not in the very front main menu? I want to have gallery room, relationship fact buttons and hint button.. it's the 3 circles..
Image
this is the design I have.. any help? Tell me if this is impossible or not ><;
I'm epic noob!

User avatar
eesy
Regular
Posts: 39
Joined: Mon May 14, 2012 3:30 am
Contact:

Re: Help with quick menu, custom buttons image

#2 Post by eesy » Tue Jun 05, 2012 12:03 pm

Hi again, I got the code to work for question number 2. But what code function to add for the auto button?

Code: Select all

            ui.imagebutton("assets/pictures/skip_idle.jpg", "assets/pictures/skip_hover.jpg", clicked=toggle_skipping, xpos=10)
            ui.imagebutton("assets/pictures/auto_idle.jpg", "assets/pictures/auto_hover.jpg", xpos=10)
<<
I'm epic noob!

User avatar
eesy
Regular
Posts: 39
Joined: Mon May 14, 2012 3:30 am
Contact:

Re: Help with quick menu, custom buttons image

#3 Post by eesy » Thu Jun 07, 2012 2:00 am

Hey I still don't know what to put to make the auto-foward button works ><;
I tried everything but never works.. Please help!

Code: Select all

init python:

    # Give us some space on the right side of the screen.
    style.window.right_padding = 100

    def toggle_skipping():
        config.skipping = not config.skipping

    show_button_game_menu = True

    def button_game_menu():
        
        if show_button_game_menu:

            # to save typing
            ccinc = renpy.curried_call_in_new_context

            ui.hbox(xpos=0.983, ypos=1.0, xanchor='right', yanchor='bottom')
            
            ui.imagebutton("assets/pictures/save_idle.jpg", "assets/pictures/save_hover.jpg", clicked=ccinc("_game_menu_save"),xpos=10)
            ui.imagebutton("assets/pictures/load_idle.jpg", "assets/pictures/load_hover.jpg", clicked=ccinc("_game_menu_load"),xpos=10) 
            ui.imagebutton("assets/pictures/settings_idle.jpg", "assets/pictures/settings_hover.jpg", clicked=ccinc("_game_menu_preferences"),xpos=10)
            ui.imagebutton("assets/pictures/skip_idle.jpg", "assets/pictures/skip_hover.jpg", clicked=toggle_skipping, xpos=10)
            ui.imagebutton("assets/pictures/auto_idle.jpg", "assets/pictures/auto_hover.jpg", xpos=10)
            
            ui.close()
    config.window_overlay_functions.append(button_game_menu)
I need to put this somewhere ?

Code: Select all

action Preference("auto-forward mode", "toggle")
just anything to make the auto-forward button works please!
thanks before.. i hope someone replies this time. Don't mind about my other questions.....
I'm epic noob!

Code Monkey
Regular
Posts: 88
Joined: Tue Apr 03, 2012 9:17 am
Projects: Dandelion
Organization: Cheritz
Location: Seoul, South Korea
Contact:

Re: Help with quick menu, custom buttons image

#4 Post by Code Monkey » Thu Jun 07, 2012 2:48 am

You're making your screen with python code and that little snippet of code you put with "action Preference" is screen language. It's best to make all your screens with screen language since it's more up to date. You can call the actions directly, so if you want to toggle auto-forward do:

Code: Select all

ToggleField(_preferences, "afm_enable")()

But this is just a wrapper for pythons setattr function, if u just want to set it u can do. "setattr(_preferences, "afm_enable", True)"

User avatar
eesy
Regular
Posts: 39
Joined: Mon May 14, 2012 3:30 am
Contact:

Re: Help with quick menu, custom buttons image

#5 Post by eesy » Thu Jun 07, 2012 10:35 am

I dont understand how to customize the imagebuttons in screen language so I changed it back to ui.imagebutton ><;
i don't get how to add the hover picture in the screen codings...
I read the documentation, and had absolutely no idea : (
I'm epic noob!

User avatar
DragoonHP
Miko-Class Veteran
Posts: 745
Joined: Tue Jun 22, 2010 12:54 am
Completed: Christmas
IRC Nick: DragoonHP
Location: Zion Island, Solario
Contact:

Re: Help with quick menu, custom buttons image

#6 Post by DragoonHP » Thu Jun 07, 2012 10:51 am

Something like this

Code: Select all

imagebutton:
                     idle ("image_name")
                     hover ("image_name") 

User avatar
eesy
Regular
Posts: 39
Joined: Mon May 14, 2012 3:30 am
Contact:

Re: Help with quick menu, custom buttons image

#7 Post by eesy » Thu Jun 07, 2012 11:37 am

Ohh thanks for the reply.
I'm still not sure where to put it so I can change the quick menus.
This is what I add to the screens.rpy template...

Code: Select all

screen quick_menu:

    # Add an in-game quick menu.
    hbox:
        style_group "quick"
    
        xalign 0.50
        yalign 1.0

        
        imagebutton: 
            idle "assets/pictures/save_idle.jpg" 
            hover "assets/pictures/save_hover.jpg" 
            action ShowMenu('save')
and it doesn't show up. Any help ? ><;
I'm epic noob!

User avatar
eesy
Regular
Posts: 39
Joined: Mon May 14, 2012 3:30 am
Contact:

Re: Help with quick menu, custom buttons image

#8 Post by eesy » Thu Jun 07, 2012 11:46 am

ah nevermind, forgot to move the rpy file to the game directory..--*head desk* sorry! still thanks for the help though ><;
and for people looking for the code, the above works ^ ^
I'm epic noob!

Post Reply

Who is online

Users browsing this forum: hell_oh_world