Adding URL as an Imagebutton Screen

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
dragonknighttara
Newbie
Posts: 23
Joined: Mon Jun 27, 2016 11:29 am
Contact:

Adding URL as an Imagebutton Screen

#1 Post by dragonknighttara » Mon Jun 27, 2016 11:35 am

Hello! I'm still fairly new to Ren'py and image buttons, but I'd like to add one to the end of a game to allow players to go to specific web links after they've played for more information on the product. I can create largely the same effect with a menu and hyperlinks, but I like the way the image buttons look better and want to have a better grasp on calling screens as well.

I'll post the code I'm using below from the Screens.rpy file, but all I keep getting is "Invalid Syntax" errors. I've tried to make sure my indentation and spacing isn't causing the issue, but I'm still not having much luck.

Code: Select all

screen end_menu_multiply:

    imagebutton auto "GUI/im_multiply_%s.png" xpos 1000 ypos 400 focus_mask True action OpenURL(weblink copied here)
and the call within the script (if relevant) looks like this:

Code: Select all

$ show_endmenu_multiply = True
Any thoughts would be appreciated, thanks!

User avatar
chocoberrie
Veteran
Posts: 254
Joined: Wed Jun 19, 2013 10:34 pm
Projects: Marshmallow Days
Contact:

Re: Adding URL as an Imagebutton Screen

#2 Post by chocoberrie » Mon Jun 27, 2016 4:22 pm

Hmmmm... I've never tried this before, so I had to do some searching for the code. :)

I'd guess that it's not working because the URL part isn't in quotation marks. It's supposed to look like this:

Code: Select all

action OpenURL("URL GOES HERE")
Also, I'm not sure you're supposed to have an underscore between show and endmenu... If the URL bit above doesn't work, try this:

Code: Select all

$ show endmenu_multiply = True
Hope this helps! :)

User avatar
dragonknighttara
Newbie
Posts: 23
Joined: Mon Jun 27, 2016 11:29 am
Contact:

Re: Adding URL as an Imagebutton Screen

#3 Post by dragonknighttara » Mon Jun 27, 2016 4:38 pm

Oh my gosh, I overlooked the quotation marks! I think that was the issue, thank you!!

User avatar
chocoberrie
Veteran
Posts: 254
Joined: Wed Jun 19, 2013 10:34 pm
Projects: Marshmallow Days
Contact:

Re: Adding URL as an Imagebutton Screen

#4 Post by chocoberrie » Mon Jun 27, 2016 4:39 pm

dragonknighttara wrote:Oh my gosh, I overlooked the quotation marks! I think that was the issue, thank you!!
Ah, those pesky quotation marks! :lol: No problem, happy to help! :D

User avatar
dragonknighttara
Newbie
Posts: 23
Joined: Mon Jun 27, 2016 11:29 am
Contact:

Re: Adding URL as an Imagebutton Screen

#5 Post by dragonknighttara » Wed Jul 13, 2016 6:03 pm

Actually bumping this again now that I've had time to beat my head against the wall enough and try to find some tutorials, but I'm having an issue calling any customized screens within the game at all - whether or not they include an imagebutton. Is there any tutorial or resources on what it looks like to both add a custom screen to the screens.rpy file and what the corresponding code should be in the script itself?

User avatar
chocoberrie
Veteran
Posts: 254
Joined: Wed Jun 19, 2013 10:34 pm
Projects: Marshmallow Days
Contact:

Re: Adding URL as an Imagebutton Screen

#6 Post by chocoberrie » Wed Jul 13, 2016 6:26 pm

I found this in the documentation! :)

User avatar
dragonknighttara
Newbie
Posts: 23
Joined: Mon Jun 27, 2016 11:29 am
Contact:

Re: Adding URL as an Imagebutton Screen

#7 Post by dragonknighttara » Thu Jul 14, 2016 10:22 am

OMG. THANK YOU. That is 100% what I needed!!

Post Reply

Who is online

Users browsing this forum: _ticlock_