Page 1 of 1

Making links to websites in the Ren'py game

Posted: Tue May 07, 2013 8:28 pm
by AERenoir
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?

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

Posted: Tue May 07, 2013 9:04 pm
by VenusEclipse
Add this to the screens.rpy, where your main menu buttons are.

Code: Select all

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

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

Posted: Wed May 08, 2013 4:15 pm
by AERenoir
What about the second one, where the link is in an in-game story menu? Is that even doable?

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

Posted: Wed May 08, 2013 5:37 pm
by VenusEclipse
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:

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

Posted: Wed May 08, 2013 6:23 pm
by AERenoir
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? >.<

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

Posted: Thu May 09, 2013 9:15 pm
by mjshi
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.

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

Posted: Thu May 09, 2013 9:51 pm
by AERenoir
Thank you!