Page 1 of 1

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

Posted: Fri Oct 28, 2022 6:50 pm
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.

Re: Can I implement ConditionSwitch into ground of Imagemap?

Posted: Fri Oct 28, 2022 7:02 pm
by laure44
You can simply use the name of the image you defined, inside quotes.

Code: Select all

ground "something"

Re: Can I implement ConditionSwitch into ground of Imagemap?

Posted: Fri Oct 28, 2022 7:28 pm
by Jetar
That worked! Thank you!