Page 3 of 8

Re: Imagebutton GUI Framework [GxImagebuttons]

Posted: Tue Mar 04, 2014 1:36 pm
by leon
Copy paste this to the end of screens.rpy:

Code: Select all

##############################################################################
# Choice
#
# Screen that's used to display in-game menus.
# http://www.renpy.org/doc/html/screen_special.html#choice

screen choice:
    window: 
        style "menu_window"        
        xalign 0.5
        yalign 0.5
        vbox:
            style "menu"
            spacing 2
            for caption, action, chosen in items:
                if action:  
                    button:
                        action action
                        style "menu_choice_button"                        
                        text caption style "menu_choice"
                else:
                    text caption style "menu_caption"

init -2 python:
    config.narrator_menu = True
    style.menu_window.set_parent(style.default)
    style.menu_choice.set_parent(style.button_text)
    style.menu_choice.clear()
    style.menu_choice_button.set_parent(style.button)
    style.menu_choice_button.xminimum = int(config.screen_width * 0.75)
    style.menu_choice_button.xmaximum = int(config.screen_width * 0.75)

Re: Imagebutton GUI Framework [GxImagebuttons]

Posted: Thu Apr 03, 2014 1:22 am
by Xerofit51
Oddly I can't seem to erase my save with this GUI. Why so?

Re: Imagebutton GUI Framework [GxImagebuttons]

Posted: Thu Apr 03, 2014 7:20 am
by leon
Add this at the end of load_save_slot screen:

Code: Select all

key "save_delete" action FileDelete(number)

Re: Imagebutton GUI Framework [GxImagebuttons]

Posted: Thu Apr 03, 2014 8:03 am
by Xerofit51
leon wrote:Add this at the end of load_save_slot screen:

Code: Select all

key "save_delete" action FileDelete(number)
Thanks for replying so fast but it didn't work

Re: Imagebutton GUI Framework [GxImagebuttons]

Posted: Thu Apr 03, 2014 11:28 am
by leon
Actually it does work if you have 3 saves, but not correctly - it always deletes the 3rd save. I really don't know what the issue is. Maybe try asking in Ren'Py Questions and Announcements...

Re: Imagebutton GUI Framework [GxImagebuttons]

Posted: Sat Apr 05, 2014 12:48 am
by dyrarendy
After saferal times i tried to modifications this code, and i have no idea.
I need help.
Really..

example :

Code: Select all

imagebutton auto "gambar/tb_galeri_%s.png" xpos 80 ypos 340 focus_mask True action ShowMenu('xtra') hovered [ Play ("test_four", "suara/click.wav"), Show("gui_tooltip", my_picture="gambar/tooltip_main_menu_extra.png", my_tt_xpos=500, my_tt_ypos=600) ] unhovered [Hide("gui_tooltip")] at config_eff
   
As We know, the "gui_tooltip" will show up if hovered, and hide if unhovered.

Code: Select all

I really need "gui_tooltip" hide when buttons was "Clicked"
This Irritating me when i try move to different screens.

any idea ?

Re: Imagebutton GUI Framework [GxImagebuttons]

Posted: Sat Apr 05, 2014 8:16 am
by leon
Add Hide("gui_tooltip") to every action like this:

Code: Select all

imagebutton auto "gambar/tb_galeri_%s.png" xpos 80 ypos 340 focus_mask True action [Hide("gui_tooltip"), ShowMenu('xtra')] hovered [ Play ("test_four", "suara/click.wav"), Show("gui_tooltip", my_picture="gambar/tooltip_main_menu_extra.png", my_tt_xpos=500, my_tt_ypos=600) ] unhovered [Hide("gui_tooltip")] at config_eff

Re: Imagebutton GUI Framework [GxImagebuttons]

Posted: Sat Apr 05, 2014 5:53 pm
by dyrarendy
Ahh... Finally .. :) thankyou leon.
Its work.

Re: Imagebutton GUI Framework [GxImagebuttons]

Posted: Sat Apr 05, 2014 6:04 pm
by dyrarendy
ah, leon, u know how to "resize" the size of "vscrollbar" at "viewport" ?
mine is kinda too small at 720 HD.

I have no idea about this.
Or, Any way to replace it with imagebuttons ?

Re: Imagebutton GUI Framework [GxImagebuttons]

Posted: Sat Apr 05, 2014 7:17 pm
by leon
Do you mean vbar? I think setting xsize should set its width.

Code: Select all

vbar value YScrollValue("vp") xsize 50
You may find the section about customizing the bars here useful - http://lemmasoft.renai.us/forums/viewto ... =51&t=9812

Re: Imagebutton GUI Framework [GxImagebuttons]

Posted: Sun Apr 06, 2014 4:36 am
by dyrarendy
well, the problems is at "vp".

Code: Select all

vbar value YScrollValue("vp") xsize 50
Anyway, what is :

Code: Select all

("vp")

Re: Imagebutton GUI Framework [GxImagebuttons]

Posted: Sun Apr 06, 2014 8:17 am
by leon

Re: Imagebutton GUI Framework [GxImagebuttons]

Posted: Tue Jun 17, 2014 5:46 am
by lyminh99
I used other resolution is 1920 x 1080. I can't adjust the position for the thumnail file screen shot in the right place cause all the three screen shot move at the same time i adjust the y or x position leave no space between them. pls help me :'(

Edit: Ah, it's ok now, sry :)

Re: Imagebutton GUI Framework [GxImagebuttons]

Posted: Mon Aug 18, 2014 11:56 pm
by DoctorScaglietti
Getting a bit of trouble implementing this. Here's what the code looks like:

Code: Select all

screen imagebuttontest:
    add "bg/imagemap/juns_room_day.png"
    imagebutton auto "sprites/full-body/(PH) Jun Full-Body.png" focus_mask True pos(400,500) action Jump("clicky")
Note: "(PH) Jun Full-Body.png" is defined as jun_full, but it seems I get an error if it's not the specific file path. Zoom is also not accepted, which I'd like to know how to get around if possible.

Code: Select all

label imagebuttontest:
    call screen imagebuttontest
    
label clicky:
    show jun at left
    jun "Awesome! It works!"
    
    jump imagebuttontest
Unfortunately, it doesn't work. (Not awesome!) Here's the traceback:

Code: Select all

I'm sorry, but an uncaught exception occurred.

While running game code:
  File "game/Dev Testing.rpy", line 38, in script
    call screen imagebuttontest
  File "renpy/common/000statements.rpy", line 426, in execute_call_screen
    store._return = renpy.call_screen(name, *args, **kwargs)
  File "game/imagemaps.rpy", line 104, in <module>
    imagebutton auto "sprites/full-body/(PH) Jun Full-Body.png" focus_mask True pos(400,500) action Jump("clicky")
  File "renpy/common/00defaults.rpy", line 97, in _imagemap_auto_function
    rv = auto_param % variant
TypeError: not all arguments converted during string formatting
Does anyone know what the issue is?

Re: Imagebutton GUI Framework [GxImagebuttons]

Posted: Tue Aug 19, 2014 1:38 am
by leon
To use the auto property you need to include %s in the image string and have appropriately named idle and hover images. Check the examples in the script and the documentation on how to use the auto property.