Page 4 of 7

Re: Imagebutton GUI Framework [GxImagebuttons]

Posted: Tue Aug 19, 2014 2:25 pm
by DoctorScaglietti
Works fine now! Still want to know how to change zoom, though. I'd like to use it for a point-and-click environment, and some images will be different sizes depending on their relative distance from the viewer (simulated through zoom). This will change from screen to screen, so doing all of them through my graphics editor is not an option.

Is there any way to utilize zoom for this? I doesn't seem to accept it as a parameter.

Re: Imagebutton GUI Framework [GxImagebuttons]

Posted: Tue Aug 19, 2014 6:14 pm
by leon
Since this is a general Ren'Py question, not related to this framework, I suggest you ask at Ren'Py Questions and Announcements. Don't forget to include all the relevant lines of your code.

Re: Imagebutton GUI Framework [GxImagebuttons]

Posted: Wed Aug 20, 2014 3:21 am
by dyrarendy
Leon, thanks so much for this Thread.
My project is full of Imagebutton now. I never touching tried imageMaps.
Even my Project is using my native language, u can seen the ATL i used into.
Take a look :

Re: Imagebutton GUI Framework [GxImagebuttons]

Posted: Sat Oct 11, 2014 9:39 am
by Altsune
Woah, this is pretty helpful! Thanks!

Re: Imagebutton GUI Framework [GxImagebuttons]

Posted: Thu Nov 13, 2014 5:07 pm
by verysunshine
I was panicking because I thought I couldn't open the file. Thanks for the plain text versions!

Re: Imagebutton GUI Framework [GxImagebuttons]

Posted: Tue Nov 18, 2014 8:31 pm
by verysunshine
I know this is just a tutorial, but I found a bug in the code. None of the sliders in the options menus have "hidden" settings.

Code: Select all

I'm sorry, but an uncaught exception occurred.

While running game code:
  File "game/screens.rpy", line 135, in <module>
    bar value Preference("music volume")
AttributeError: 'ScreenDisplayable' object has no attribute 'hiding'

-- Full Traceback ------------------------------------------------------------

Full traceback:
  File "renpy/common/_layout/screen_main_menu.rpym", line 29, in script
    $ ui.interact()
  File "/Applications/renpy-6.18.0-sdk/renpy/ast.py", line 778, in execute
    renpy.python.py_exec_bytecode(self.code.bytecode, self.hide, store=self.store)
  File "/Applications/renpy-6.18.0-sdk/renpy/python.py", line 1382, in py_exec_bytecode
    exec bytecode in globals, locals
  File "renpy/common/_layout/screen_main_menu.rpym", line 29, in <module>
    $ ui.interact()
  File "/Applications/renpy-6.18.0-sdk/renpy/ui.py", line 247, in interact
    rv = renpy.game.interface.interact(roll_forward=roll_forward, **kwargs)
  File "/Applications/renpy-6.18.0-sdk/renpy/display/core.py", line 2145, in interact
    repeat, rv = self.interact_core(preloads=preloads, **kwargs)
  File "/Applications/renpy-6.18.0-sdk/renpy/display/core.py", line 2393, in interact_core
    root_widget.visit_all(lambda i : i.per_interact())
  File "/Applications/renpy-6.18.0-sdk/renpy/display/core.py", line 335, in visit_all
    d.visit_all(callback)
  File "/Applications/renpy-6.18.0-sdk/renpy/display/core.py", line 335, in visit_all
    d.visit_all(callback)
  File "/Applications/renpy-6.18.0-sdk/renpy/display/core.py", line 335, in visit_all
    d.visit_all(callback)
  File "/Applications/renpy-6.18.0-sdk/renpy/display/core.py", line 335, in visit_all
    d.visit_all(callback)
  File "/Applications/renpy-6.18.0-sdk/renpy/display/screen.py", line 380, in visit_all
    callback(self)
  File "/Applications/renpy-6.18.0-sdk/renpy/display/core.py", line 2393, in <lambda>
    root_widget.visit_all(lambda i : i.per_interact())
  File "/Applications/renpy-6.18.0-sdk/renpy/display/screen.py", line 392, in per_interact
    self.update()
  File "/Applications/renpy-6.18.0-sdk/renpy/display/screen.py", line 551, in update
    self.screen.function(**self.scope)
  File "/Applications/renpy-6.18.0-sdk/renpy/screenlang.py", line 1247, in __call__
    renpy.python.py_exec_bytecode(self.code.bytecode, locals=scope)
  File "/Applications/renpy-6.18.0-sdk/renpy/python.py", line 1382, in py_exec_bytecode
    exec bytecode in globals, locals
  File "game/screens.rpy", line 135, in <module>
    bar value Preference("music volume")
  File "/Applications/renpy-6.18.0-sdk/renpy/ui.py", line 446, in __call__
    if (renpy.display.focus.grab is w) and (not screen.hiding):
AttributeError: 'ScreenDisplayable' object has no attribute 'hiding'

Darwin-10.8.0-i386-64bit
Ren'Py 6.18.0.635
Renpy Imagebuttons GUI Sample 1.0

Re: Imagebutton GUI Framework [GxImagebuttons]

Posted: Wed Nov 19, 2014 5:23 pm
by PyTom
That's a bug in 16.18.0. Upgrade to a newer version of Ren'Py to fix it.

Re: Imagebutton GUI Framework [GxImagebuttons]

Posted: Wed Nov 19, 2014 10:00 pm
by verysunshine
Thank you, PyTom!

Re: Imagebutton GUI Framework [GxImagebuttons]

Posted: Sun Mar 22, 2015 12:26 pm
by Luxliev
That's amazing tutorial thanks to all that helped to make it. Great that you also added documentation links.
Animation of home/title screen button (one that spins) made me laugh out loud. I also like that lucy_proud.png has 4 brows.

Re: Imagebutton GUI Framework [GxImagebuttons]

Posted: Thu Mar 26, 2015 3:09 am
by TrailsInTheSky
Thanks alot :)

Re: Imagebutton GUI Framework [GxImagebuttons]

Posted: Sat May 02, 2015 1:50 pm
by Ordagon
Hi, first of all THANK YOU. I think this tutorial is awesome. But somehow I can't replicate it in my game.
I am working in a game, and in certain part you play rock, paper, scissors. And of course I used an image map to make it look good. Then I heard about using image buttons and I fell in love with the idea. I will describe the process I go through(more or less)

1º I create the png's and call them rock_idle.png and rock_hover.png and place them in the gui folder
2º I add the code in screens.rpy
screen rpsmenu:
imagebutton auto "gui/rock_%s.png" xpos 712 ypos 414 focus_mask True action Return("rock")
3º save it
4º I write the code show rpsmenu in the part of the script.rpy where I need the game to appear
5º save it
6º then i run the game and what I get is a grey silhoute with the text rpsmenu

I think I am forgetting something, but don't know what. If you could tell me what I am doing wrong would be great.
Thanks in advance for your time. I am using version 6.99.3.404

Re: Imagebutton GUI Framework [GxImagebuttons]

Posted: Sat May 02, 2015 5:41 pm
by leon
I suggest you start a new thread at Ren'Py Questions and Announcements and include your game files.

Re: Imagebutton GUI Framework [GxImagebuttons]

Posted: Sun Sep 27, 2015 4:25 am
by bloodyhair
Thank you so much for the tutorial :3 ~ *bow to the epicness of imagebutton*

anyway, I am wondering if you make a BIG button by accident, is there any way to make it smaller by code?

Re: Imagebutton GUI Framework [GxImagebuttons]

Posted: Thu Oct 08, 2015 2:21 pm
by leon
It's best to resize it in your favorite image editor, but if you want to do it by code there's a few ways to do it - http://lemmasoft.renai.us/forums/viewto ... f=8&t=9185

Re: Imagebutton GUI Framework [GxImagebuttons]

Posted: Tue Oct 13, 2015 10:37 pm
by bloodyhair
Yup it is solved. Thank you very much.

if you don't mind I want to ask a bit about main menu button in your tutorial.

Code: Select all

imagebutton auto "gui/main_start_%s.png" xpos 773 ypos y focus_mask True action Start() hovered [ Play ("test_one", "sfx/click.wav"), Show("gui_tooltip", my_picture="gui/tooltip_main_menu_start.png", my_tt_xpos=46, my_tt_ypos=518) ] unhovered [Hide("gui_tooltip")] at main_eff1
1. what is "test_one" ? Is that important? Is that only a name (string) or it is connected to data in game folder? If I want to change the sfx with my own, do I still need to add "test_one" or I can directly put "sounds_test.wav"?

2. what is main_eff1?

thank you very much