Unresponsive image buttons [SOLVED]
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.
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.
- Hikari_Kaitou
- Newbie
- Posts: 12
- Joined: Mon Sep 18, 2023 9:14 pm
- Tumblr: hikari-kaitou
- Contact:
Unresponsive image buttons [SOLVED]
Hello everyone, I'm new here and new to RenPy and I'm having kind of a strange problem. I suddenly can't get my image buttons to function. The hover states don't work and they don't perform the action I've programmed them to. There are no error reports, it simply doesn't work. I followed a video tutorial on youtube (https://www.youtube.com/watch?v=BJ3pqhQf2Rw) to the letter and it just does nothing. I realize that most of my actions say "Null", that's not the issue; the issue is that the hover version of the image doesn't appear and the jump doesn't work. Is this a matter of RenPy 8.1 working differently from older versions or am I missing something here?
Last edited by Hikari_Kaitou on Wed Sep 20, 2023 10:01 pm, edited 1 time in total.
- Ocelot
- Lemma-Class Veteran
- Posts: 2407
- Joined: Tue Aug 23, 2016 10:35 am
- Github: MiiNiPaa
- Discord: MiiNiPaa#4384
- Contact:
Re: Unresponsive image buttons
First two buttons might as well be not present. Third ove will be drawn over them and prevent them from ever working.
Third button will not receive any hover/unhover event since it lacks a proper on click Action.
As a bonus, you should not use hover/unhover actions to show tooltips (as it is unreliable, there are ways to get a hovered event without then triggering unhovered and vice versa) you should use tooltip property for that.
Third button will not receive any hover/unhover event since it lacks a proper on click Action.
As a bonus, you should not use hover/unhover actions to show tooltips (as it is unreliable, there are ways to get a hovered event without then triggering unhovered and vice versa) you should use tooltip property for that.
< < insert Rick Cook quote here > >
- Imperf3kt
- Lemma-Class Veteran
- Posts: 3794
- Joined: Mon Dec 14, 2015 5:05 am
- itch: Imperf3kt
- Location: Your monitor
- Contact:
Re: Unresponsive image buttons
In addition to the above, your indentation is not right, you are using 8 spaces, but you should be using 4
Here's an example of one way to use imagebuttons
Here's an example of one way to use imagebuttons
Code: Select all
screen myScreen():
modal True
fixed:
spacing 10
imagebutton:
auto "gui/myimage_1_%s.png"
focus_mask True
hovered <hovered action>
unhovered <unhovered action>
action NullAction()
imagebutton:
auto "gui/myimage_2_%s.png"
focus_mask True
hovered <hovered action>
unhovered <unhovered action>
action NullAction()
imagebutton:
auto "gui/myimage_3_%s.png"
focus_mask True
hovered <hovered action>
unhovered <unhovered action>
action NullAction()
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
pro·gram·mer (noun) An organism capable of converting caffeine into code.
Current project: GGD Mentor
- Hikari_Kaitou
- Newbie
- Posts: 12
- Joined: Mon Sep 18, 2023 9:14 pm
- Tumblr: hikari-kaitou
- Contact:
- Hikari_Kaitou
- Newbie
- Posts: 12
- Joined: Mon Sep 18, 2023 9:14 pm
- Tumblr: hikari-kaitou
- Contact:
- Ocelot
- Lemma-Class Veteran
- Posts: 2407
- Joined: Tue Aug 23, 2016 10:35 am
- Github: MiiNiPaa
- Discord: MiiNiPaa#4384
- Contact:
Re: Unresponsive image buttons
Depending on what you need, wrap them in hbox/vbox to lay them out horisontally/vertically or just provide them their positions with xpos/ypos or xalign/yalign
< < insert Rick Cook quote here > >
- Hikari_Kaitou
- Newbie
- Posts: 12
- Joined: Mon Sep 18, 2023 9:14 pm
- Tumblr: hikari-kaitou
- Contact:
Re: Unresponsive image buttons
Ok, I tried a different approach. Now the action that's supposed to happen does function, but it still doesn't show the idle or hover images. I still don't get an error message.Ocelot wrote: ↑Tue Sep 19, 2023 11:17 amDepending on what you need, wrap them in hbox/vbox to lay them out horisontally/vertically or just provide them their positions with xpos/ypos or xalign/yalign
Code: Select all
screen waterfall_nav():
imagemap:
ground "forest 3 by brgfx_idle"
fixed:
spacing 10
imagebutton:
xpos 1562
ypos 961
idle "forest 3 by brgfx barley_idle"
hover "forest_3_by_brgfx_barley_hover"
action Jump("barley")
- Imperf3kt
- Lemma-Class Veteran
- Posts: 3794
- Joined: Mon Dec 14, 2015 5:05 am
- itch: Imperf3kt
- Location: Your monitor
- Contact:
Re: Unresponsive image buttons
That depends.Hikari_Kaitou wrote: ↑Tue Sep 19, 2023 11:11 amDoes incorrect spacing prevent the code from functioning?
https://www.renpy.org/doc/html/language ... and-blocks
Indentation is very important to Ren'Py, and cause syntax or logical errors when it's incorrect.
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
pro·gram·mer (noun) An organism capable of converting caffeine into code.
Current project: GGD Mentor
- Hikari_Kaitou
- Newbie
- Posts: 12
- Joined: Mon Sep 18, 2023 9:14 pm
- Tumblr: hikari-kaitou
- Contact:
Re: Unresponsive image buttons
I'm not getting an error message, so hopefully that means the spacing is ok?
- Hikari_Kaitou
- Newbie
- Posts: 12
- Joined: Mon Sep 18, 2023 9:14 pm
- Tumblr: hikari-kaitou
- Contact:
Re: Unresponsive image buttons
Every time I create a second button, it overwrites the first button's function. I don't understand. I've already created four imagebuttons successfully on a different screen and they work just fine. These new imagebuttons look the same coding-wise but they don't work...
Re: Unresponsive image buttons
What's the size of your imagebuttons - any chance that they are overlap each other (as Ocelot pointed)?Hikari_Kaitou wrote: ↑Tue Sep 19, 2023 4:34 pm Every time I create a second button, it overwrites the first button's function. ...
How do you positioning them (are they inside a v/hbox, grid or have individual coordinates)?
- Hikari_Kaitou
- Newbie
- Posts: 12
- Joined: Mon Sep 18, 2023 9:14 pm
- Tumblr: hikari-kaitou
- Contact:
Re: Unresponsive image buttons
Here's my codeAlex wrote: ↑Wed Sep 20, 2023 2:20 pmWhat's the size of your imagebuttons - any chance that they are overlap each other (as Ocelot pointed)?Hikari_Kaitou wrote: ↑Tue Sep 19, 2023 4:34 pm Every time I create a second button, it overwrites the first button's function. ...
How do you positioning them (are they inside a v/hbox, grid or have individual coordinates)?
Code: Select all
screen waterfall_nav():
imagemap:
ground "forest 3 by brgfx_idle"
imagebutton:
xpos 1562
ypos 961
hover "forest_barley_hover"
idle "forest_barley_idle"
action Jump("barley")
imagebutton:
xpos 242
ypos 658
hover "forest_muscat_hover"
idle "forest_muscat_idle"
action Jump("muscat")
imagebutton:
xpos 524
ypos 954
hover "forest_chamomile_hover"
idle "forest_chamomile_idle"
action Jump("chamomile")
Re: Unresponsive image buttons
So, what about size of those 'forest' images?
- Hikari_Kaitou
- Newbie
- Posts: 12
- Joined: Mon Sep 18, 2023 9:14 pm
- Tumblr: hikari-kaitou
- Contact:
Re: Unresponsive image buttons
- Hikari_Kaitou
- Newbie
- Posts: 12
- Joined: Mon Sep 18, 2023 9:14 pm
- Tumblr: hikari-kaitou
- Contact:
Re: Unresponsive image buttons
Someone helped me figure out the problem. My hover and idle images didn't need all that transparent space. After cropping the images down, they fit on the screen properly. Thank you to everyone who advised me!
Who is online
Users browsing this forum: Houseofmine, Kia