Can I attach an image here?

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
Nanahs
Veteran
Posts: 310
Joined: Wed Aug 22, 2018 5:50 pm
Contact:

Can I attach an image here?

#1 Post by Nanahs »

If I'm using a code like this:

Code: Select all

    python:
        choice = randint(1,3)

    if choice == 1:
        $card = "star"    
    elif choice == 2:
        $card = "heart"
    else:
        $card = "circle"
Is it possible to attach an image with the "card"? Because as the result appears, it would also show the image.

I tried using this (and also "show" instead of add):

Code: Select all

    if choice == 1:
        $card = "star":
            add "star.png"
    elif choice == 2:
        $card = "heart":
            add "heart.png"
    else:
        $card = "circle":
            add "circle.png"
But it didn't work. I'm not sure if I can attach an image to this kind of code.

Thanks :)

Post Reply

Who is online

Users browsing this forum: No registered users