Page 1 of 1

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

Posted: Sun Mar 18, 2018 1:13 am
by Eldormain
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

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

Posted: Mon Mar 19, 2018 12:34 pm
by DannX
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.

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

Posted: Thu Apr 26, 2018 2:46 pm
by serafcaine
how wold you this without splashscreen, lets say at the end of the game. I cant figure this one out

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

Posted: Thu Apr 26, 2018 3:40 pm
by kivik
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.