Adding web links

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
Timberduck
Regular
Posts: 60
Joined: Sat Jan 04, 2014 12:52 am
Location: Canada
Contact:

Adding web links

#1 Post by Timberduck » Sat Jan 11, 2014 2:02 am

Is it possible to add web-links in renspy?

Timberduck
Regular
Posts: 60
Joined: Sat Jan 04, 2014 12:52 am
Location: Canada
Contact:

Re: Adding web links

#2 Post by Timberduck » Sat Jan 11, 2014 2:22 am

lol found out you can.

Now is there a way to select a menu option or an image which opens the link automatically?

User avatar
Alex
Lemma-Class Veteran
Posts: 2981
Joined: Fri Dec 11, 2009 5:25 pm
Contact:

Re: Adding web links

#3 Post by Alex » Sat Jan 11, 2014 5:35 am

Try

Code: Select all

init python:
    import webbrowser
    
screen scr:
    textbutton "url" action OpenURL("http://www.renpy.org/doc/html/screen_actions.html#other-actions") xalign 1.0 yalign 0.0

# The game starts here.
label start:
    show screen scr

    "Why don't you visit {a=http://renpy.org}Ren'Py's home page{/a}?"
    menu:
        "url":
            $ webbrowser.open_new("http://www.renpy.org/doc/html/screen_actions.html#other-actions")
    "..."

Timberduck
Regular
Posts: 60
Joined: Sat Jan 04, 2014 12:52 am
Location: Canada
Contact:

Re: Adding web links

#4 Post by Timberduck » Sat Jan 11, 2014 6:03 am

WOW!!!

Thanks AGAIN ALEX!!!

Post Reply

Who is online

Users browsing this forum: Google [Bot]