Hyperlink to an Image? [solved]

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
Morhighan
Miko-Class Veteran
Posts: 975
Joined: Sun Jun 27, 2010 12:54 pm
Completed: AIdol, When Our Journey Ends, Forgotten Not Lost
Organization: MysteryCorgi
Tumblr: MysteryCorgi
Deviantart: MysteryCorgi
Soundcloud: MysteryCorgi
itch: MysteryCorgi
Location: USA
Contact:

Hyperlink to an Image? [solved]

#1 Post by Morhighan »

So for the game I'm working on I want to include "attachments" where you can click on the hyperlink and an overlay will pop up with an image.

I'm not sure how to go about this.

Currently I have the following, but it isn't working:

"script1.rpy" has this:
Sickle "a02 Sickle_44 sent an attachment."
Sickle "a02 {a=attachment_cg01}attachment{/a}"
And then in "Attachment.rpy" I have:

Code: Select all

    show cg01 onlayer overlay at truecenter
    hide cg01
Last edited by Morhighan on Wed Sep 28, 2016 5:36 am, edited 1 time in total.

User avatar
Divona
Miko-Class Veteran
Posts: 678
Joined: Sun Jun 05, 2016 8:29 pm
Completed: The Falconers: Moonlight
Organization: Bionic Penguin
itch: bionicpenguin
Contact:

Re: Hyperlink to an Image?

#2 Post by Divona »

If I understand it right, the code would be:

Code: Select all

label start:
    Sickle "a02 Sickle_44 sent an attachment."
    Sickle "a02 {a=attachment_cg01}attachment{/a}"

    return

label attachment_cg01:
    show cg01 onlayer overlay at truecenter
    $ renpy.pause(5, hard=True)
    hide cg01

    return
Completed:
Image

User avatar
Morhighan
Miko-Class Veteran
Posts: 975
Joined: Sun Jun 27, 2010 12:54 pm
Completed: AIdol, When Our Journey Ends, Forgotten Not Lost
Organization: MysteryCorgi
Tumblr: MysteryCorgi
Deviantart: MysteryCorgi
Soundcloud: MysteryCorgi
itch: MysteryCorgi
Location: USA
Contact:

Re: Hyperlink to an Image?

#3 Post by Morhighan »

@Divona

That worked, thank you!

Post Reply

Who is online

Users browsing this forum: Bing [Bot], Google [Bot]