opening a webpage with Renpy
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.
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.
- kuroi
- Regular
- Posts: 129
- Joined: Fri Jun 29, 2007 10:50 am
- Location: Albuquerque, New Mexico, USA
- Contact:
opening a webpage with Renpy
I was thinking about the renpy help button today. That button opens an html help file in whatever browser the user has set as their default. Would it be possible to use this functionality to place a button into my game which would open my website in the user's browser instead?
President, Planner, and Programmer for Kuroi Games!
- killdream
- Veteran
- Posts: 325
- Joined: Wed Nov 05, 2008 1:05 pm
- Projects: EVūL (WIP), insilo (WIP), Cute Demon Crashers!
- Deviantart: robotlolita
- Github: robotlolita
- Location: World's End (aka Brazil)
- Contact:
Re: opening a webpage with Renpy
You can use the webbrowser module to launch it. Just import it on the init section and use the open function to launch whatever page in the default browser.
If you get an error like ("module not found") it's because Ren'Py doesn't ship with this module, so you'll have to download it manually from Python's SVN and put on your game folder.
Code: Select all
init python:
import webbrowser
label launch_mysite:
$ webbrowser.open("http://www.mysite.com/")
- kuroi
- Regular
- Posts: 129
- Joined: Fri Jun 29, 2007 10:50 am
- Location: Albuquerque, New Mexico, USA
- Contact:
Re: opening a webpage with Renpy
That's a ton! That's waaaaay easier than I thought it would be~
President, Planner, and Programmer for Kuroi Games!
- Jo'ogn
- Veteran
- Posts: 398
- Joined: Sat Jul 12, 2008 1:31 pm
- Projects: Kassiopeia [iVN]
- Location: Deutschland
- Contact:
Re: opening a webpage with Renpy
Wasn't there even just an {URL} tag for text?
Audio Plays: [original] The White Feathers Directive - [Star Wars] Through Flame and Shadow
Ren'Py: Kassiopeia [very interactive VN] work in progress - looking for proof reader english
Ren'Py: Kassiopeia [very interactive VN] work in progress - looking for proof reader english
