imagebutton help

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
Hoseigndie
Newbie
Posts: 24
Joined: Sat Jun 02, 2018 3:00 pm
Contact:

imagebutton help

#1 Post by Hoseigndie » Fri Sep 07, 2018 3:59 pm

Hello, in first, excuse my bag english ;)

I have a problem with my game.
I want create a imagebutton, but I need help for my code.
I make that :

init:
$ test_01 = True

label chapter_01:
scene map_01
if test_01:
imagebutton:
xpos 402 ypos 22
idle "images/localisation_01.png"
hover "images/localisation_02.png"
action [jump chapter_02]


But I have a "expected statement" ...
Thanks for your help ...

User avatar
MaydohMaydoh
Regular
Posts: 101
Joined: Mon Jul 09, 2018 5:49 am
Projects: Fuwa Fuwa Panic
Tumblr: maydohmaydoh
Location: The Satellite of Love
Contact:

Re: imagebutton help

#2 Post by MaydohMaydoh » Fri Sep 07, 2018 4:25 pm

You're using screen language in a label. What you want to do is make a screen with the button in it and then show the screen, also define your variable with default instead of a python statement.

Code: Select all

default test_01 =True

screen test():
    if test_01:
        imagebutton:
            xpos 402 ypos 22
            idle "images/localisation_01.png"
            hover "images/localisation_02.png"
            action Jump("chapter_02")

label chapter_01:
    scene map_01
    show screen test
    "This is a button."

Hoseigndie
Newbie
Posts: 24
Joined: Sat Jun 02, 2018 3:00 pm
Contact:

Re: imagebutton help

#3 Post by Hoseigndie » Fri Sep 07, 2018 4:34 pm

Great, It's exactly that !!!
Thanks !!!!

Post Reply

Who is online

Users browsing this forum: Google [Bot]