I got stuck with imagebuttons. [SOLVED]

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
Modzso
Newbie
Posts: 24
Joined: Fri Jun 24, 2016 5:38 am
Projects: Ghosts of Fablees - Chapter 1.
Tumblr: captainmodzso
Deviantart: nephle
Contact:

I got stuck with imagebuttons. [SOLVED]

#1 Post by Modzso »

Better afternoon.

I give up, I want to make a nice looking shop screen to buy things. I made a screen with the image buttons. Sample

Code: Select all

image kijelolve_smallhppotion_hover = "images/boltmenu/kijelolve_smallhppotion.png" 
image kijelolve_smallenergypotion_hover = "images/boltmenu/kijelolve_smallenergypotion.png"
image kijelolve_mediumhppotion_hover = "images/boltmenu/kijelolve_mediumhppotion.png"
image kijelolve_mediumenergypotion_hover = "images/boltmenu/kijelolve_mediumenergypotion.png"
image kijelolve_largehppotion_hover = "images/boltmenu/kijelolve_largehppotion.png"
image kijelolve_largeenergypotion_hover = "images/boltmenu/kijelolve_largeenergypotion.png"

image kijelolve_alsomenu_close_hover = "images/boltmenu/kijelolve_alsomenu_close.png"

screen boltvasarlas1:
    
    add "images/boltmenu/shop_menu_buy.png"
 
    imagebutton idle "images/boltmenu/nincskijelolve_smallhppotion.png" hover "kijelolve_smallhppotion_hover" xpos 624 ypos 57 action Function(renpy.jump, label="smallhppotion_buy") 
    imagebutton idle "images/boltmenu/nincskijelolve_smallenergypotion.png" hover "kijelolve_smallenergypotion_hover" xpos 25 ypos 56 action Function(renpy.jump, label="smallenergypotion_buy") 
    imagebutton idle "images/boltmenu/nincskijelolve_mediumhppotion.png" hover "kijelolve_mediumhppotion_hover" xpos 624 ypos 224 action Function(renpy.jump, label="mediumhppotion_buy") 
    imagebutton idle "images/boltmenu/nincskijelolve_mediumenergypotion.png" hover "kijelolve_mediumenergypotion_hover" xpos 25 ypos 224 action Function(renpy.jump, label="mediumenergypotion_buy") 
    imagebutton idle "images/boltmenu/nincskijelolve_largehppotion.png" hover "kijelolve_largehppotion_hover" xpos 623 ypos 393 action Function(renpy.jump, label="largehppotion_buy") 
    imagebutton idle "images/boltmenu/nincskijelolve_largeenergypotion.png" hover "kijelolve_largeenergypotion_hover" xpos 25 ypos 392 action Function(renpy.jump, label="largeenergypotion_buy") 

    imagebutton idle "images/boltmenu/nincskijelolve_close.png" hover "kijelolve_alsomenu_close_hover" xpos 439 ypos 545 action Jump("boltmenu") 
Everything works fine. All the buttons do what they have to do, you can buy if you have enough money, you get "you dont have enough money" message if you dont have enough. No error... but when I click elsewhere on the screen Sample except the purchasable items, it always wanted to buy the small hp potion. Doesnt matter where I click outside the buttons.

I ran out of ideas, What could be the problem? I have a working map as the same way above, and other things with image buttons... but I can not figure it out why this is not working well...
I cleared the cache... I deleted all the rpcy files... Someone has some idea? If more information is needed I will post that. :)
Last edited by Modzso on Mon Aug 21, 2017 10:20 am, edited 1 time in total.

User avatar
Modzso
Newbie
Posts: 24
Joined: Fri Jun 24, 2016 5:38 am
Projects: Ghosts of Fablees - Chapter 1.
Tumblr: captainmodzso
Deviantart: nephle
Contact:

Re: I got stuck with imagebuttons.

#2 Post by Modzso »

Okay, I'm officially stupid! :D

I solved the problem! I used "show" the screen not "call"... :D And somehow it works fine now... :)

Post Reply

Who is online

Users browsing this forum: Bing [Bot], LegsWild, Toma