Embed an External Link in an Image (link to website)

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
Eldormain
Newbie
Posts: 2
Joined: Thu Dec 14, 2017 11:44 pm
Contact:

Embed an External Link in an Image (link to website)

#1 Post by Eldormain » Sun Mar 18, 2018 1:13 am

Hello. I have a title page before the main menu (splashscreen) with an image of an external website. This screen constitutes a background image with the stories title and creator as part of it and a smaller image over top of the background with the logo of an external website. I would like a player to be able to click the smaller image to open the external website in their computers browser.

Code: Select all

label splashscreen:
    scene black
    with Pause(1)

    scene disclaimer_01 with dissolve
    $ renpy.pause()

    scene

    scene Website_01
    show Website_02
    
    $ renpy.pause()

return
More then just that I think I need some complete dumbed-down answers. It might just be my lack of coding knowledge but I think most of the answers I have come across aren't complete. Or at least my knowledge isn't complete enough. With the different versions of the program over the years placement of things have change, best I can tell.

With that being said I am looking for the coding to do what I explained above. Also, I need to know as specifically as possible where the code needs to go (ie: under Main and Game Menu Screens > Main Menu screen). As well as any supporting code (again, unless I'm mistaken, some code needs other code under a specific section of another tab).

I see this all the time in other VNs and can only image it isnt' that difficult. I just haven't been able to work it out. What I am using and their version are:
Ren'Py 6.99.14.1.3218
Atom 1.25.0

Eldormain
There are 10 types of people in the world. Those who know binary and those who don't.

DannX
Regular
Posts: 57
Joined: Mon Mar 12, 2018 11:15 am
Contact:

Re: Embed an External Link in an Image (link to website)

#2 Post by DannX » Mon Mar 19, 2018 12:34 pm

Maybe what you need is a screen displaying an imagebutton with the OpenURL screen action:

Code: Select all

#The screen can be in any .rpy file, even one you create
screen title_url():
    #Add the imagebutton, providing the image name and the screen action 
    #with the url you want to open.
    imagebutton idle 'Website_02' action OpenURL("http://my_website.com")

label splashscreen:
    scene black
    with Pause(1)

    scene disclaimer_01 with dissolve
    $ renpy.pause()

    scene Website_01
    show screen title_url #And show the screen here
    
    $ renpy.pause()

    return
Hope this helps.

serafcaine
Newbie
Posts: 5
Joined: Wed Apr 25, 2018 5:42 pm
Contact:

Re: Embed an External Link in an Image (link to website)

#3 Post by serafcaine » Thu Apr 26, 2018 2:46 pm

how wold you this without splashscreen, lets say at the end of the game. I cant figure this one out

kivik
Miko-Class Veteran
Posts: 784
Joined: Fri Jun 24, 2016 5:58 pm
Contact:

Re: Embed an External Link in an Image (link to website)

#4 Post by kivik » Thu Apr 26, 2018 3:40 pm

serafcaine wrote:
Thu Apr 26, 2018 2:46 pm
how wold you this without splashscreen, lets say at the end of the game. I cant figure this one out
You put the code that's currently inside the splashscreen label, inside your ending label - or wherever your game ends.

I'd highly recommend you read through the entire online documentation just to get to grips with label controls, screens etc.

Post Reply

Who is online

Users browsing this forum: No registered users