[Solved]Can I implement ConditionSwitch into ground of Imagemap?

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
Jetar
Newbie
Posts: 8
Joined: Sat May 21, 2022 10:05 am
Contact:

[Solved]Can I implement ConditionSwitch into ground of Imagemap?

#1 Post by Jetar »

This. I have image statement with ConditionSwitch:

Code: Select all

image something = ConditionSwitch(
"x == 1","images/thing_1.jpg",
"x == 2","images/thing_2.jpg",
"x == 3","images/thing_3.jpg",
"x == 4","images/thing_4.jpg",
)
And I have screen with imagemap:

Code: Select all

screen whatever:
    imagemap:
        ground
I want to go DRY and reuse image something into the ground argument of imagemap statement. Can I do that? I've done some googing and it shows nothing.
Last edited by Jetar on Fri Oct 28, 2022 7:29 pm, edited 1 time in total.

laure44
Regular
Posts: 84
Joined: Mon Mar 08, 2021 10:55 pm
Projects: Arkan'sTower, Gemshine Lorelei!
Location: France
Contact:

Re: Can I implement ConditionSwitch into ground of Imagemap?

#2 Post by laure44 »

You can simply use the name of the image you defined, inside quotes.

Code: Select all

ground "something"

User avatar
Jetar
Newbie
Posts: 8
Joined: Sat May 21, 2022 10:05 am
Contact:

Re: Can I implement ConditionSwitch into ground of Imagemap?

#3 Post by Jetar »

That worked! Thank you!

Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot], crowcinthus, Google [Bot], Yahoo [Bot]