Making links to websites in the Ren'py game

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
AERenoir
Veteran
Posts: 265
Joined: Fri May 27, 2011 8:23 pm
Contact:

Making links to websites in the Ren'py game

#1 Post by AERenoir » Tue May 07, 2013 8:28 pm

The idea is either making a link to the website/devblog at the main menu and/or (if possible) make another link-button IN the game itself. Like, for example, after the prologue I have a splash screen or whatever where I put up two options. One saying "go to site" and one saying "start game". The "go to site" button should link to whatever site I want it to be.

Are either of those possible to do?

User avatar
VenusEclipse
Veteran
Posts: 348
Joined: Fri Mar 13, 2009 5:26 pm
Completed: Princess of Ruin, Frozen Essence, Legend of the Piper Girl, Heartstring Bugs
Projects: Shrouded In Haze
Organization: Unbroken Hours
Tumblr: unbrokenhours
Deviantart: venus-eclipse
Location: Canada
Contact:

Re: Making links to websites in the Ren'py game

#2 Post by VenusEclipse » Tue May 07, 2013 9:04 pm

Add this to the screens.rpy, where your main menu buttons are.

Code: Select all

textbutton _("Visit Website") action OpenURL("http://your_url.com")

User avatar
AERenoir
Veteran
Posts: 265
Joined: Fri May 27, 2011 8:23 pm
Contact:

Re: Making links to websites in the Ren'py game

#3 Post by AERenoir » Wed May 08, 2013 4:15 pm

What about the second one, where the link is in an in-game story menu? Is that even doable?

User avatar
VenusEclipse
Veteran
Posts: 348
Joined: Fri Mar 13, 2009 5:26 pm
Completed: Princess of Ruin, Frozen Essence, Legend of the Piper Girl, Heartstring Bugs
Projects: Shrouded In Haze
Organization: Unbroken Hours
Tumblr: unbrokenhours
Deviantart: venus-eclipse
Location: Canada
Contact:

Re: Making links to websites in the Ren'py game

#4 Post by VenusEclipse » Wed May 08, 2013 5:37 pm

Do you mean with the shortcut buttons where the textbox is? You can use the same code there if you're still using screen language. Just stick it with the other textbutton codes.

If you're talking about the prompting the user to go, I'm not sure how to do that.

If I misunderstand where you want to put it, just say so. :mrgreen:

User avatar
AERenoir
Veteran
Posts: 265
Joined: Fri May 27, 2011 8:23 pm
Contact:

Re: Making links to websites in the Ren'py game

#5 Post by AERenoir » Wed May 08, 2013 6:23 pm

Actually, what I want is like this. When you start the game, you have a prologue. After the prologue, I have something like a character select menu (an imagemap). So if I release a demo where one of the characters to select is not available yet, clicking on that unavailable character would link to the devblog instead of progressing with the story.

Does that make sense? >.<

User avatar
mjshi
Regular
Posts: 179
Joined: Wed Mar 13, 2013 9:55 pm
Completed: MazeSite01, Ponderings of Time
Organization: Solo
Deviantart: mjshii
Skype: mjshii
Soundcloud: mjshi
Contact:

Re: Making links to websites in the Ren'py game

#6 Post by mjshi » Thu May 09, 2013 9:15 pm

Then on the imagemap you would substitute the action for
"action OpenURL("http://your_url.com")"

Example (from my demo game):

Code: Select all

imagemap:
        ground "main_menu_idle.png"
        hover "main_menu_hover.png"
            
        hotspot (96,416,288,39) action Start()
        hotspot (96,460,288,40) action ShowMenu("preferences")
        hotspot (434,416,288,39) action ShowMenu("load")
        hotspot (434,460,288,40) action Quit(confirm=False)
you would substitute one of the "action"s for

Code: Select all

action OpenURL("http://your_url.com")
Except where mine is for the main menu yours would be for the start of the game.
And the hotspots would all be "action Start("LABELNAME")"
except for the OpenURL one.

User avatar
AERenoir
Veteran
Posts: 265
Joined: Fri May 27, 2011 8:23 pm
Contact:

Re: Making links to websites in the Ren'py game

#7 Post by AERenoir » Thu May 09, 2013 9:51 pm

Thank you!

Post Reply

Who is online

Users browsing this forum: Bing [Bot], Google [Bot]