Page 1 of 1

Imagemap using interpolation

Posted: Tue Jan 28, 2020 5:05 pm
by BigBucket
Hi

I saw a video on youtube using interpolation to call an image so I assumed I could try and use it with an imagemap

I set a variable fo the time of the day, and this will decide wich image will be used for the imagemap

The images are named "overworld_day_hover/idle/ground" and "overworld_night_hover/idle/ground", so I used the following code:

Code: Select all

default time_of_day = "day"

screen overworld():
    imagemap:
        auto "gui/overworld_[time_of_day]_%s.png"
        hotspot (245, 149, 105, 124) clicked [ Hide("overworld"), Jump("teste")]
        hotspot (244, 466, 104, 155) clicked [ Hide("overworld"), Jump("teste")]
But when I clink on the icon that should bring this overworld screen there's an "Exception: Could not find a ground image for imagemap" error.

Is it not possible to use it for imagemaps os am I doing it wrong?

Re: Imagemap using interpolation

Posted: Tue Jan 28, 2020 5:20 pm
by Angelo Seraphim
Do you have a "gui/overworld_..._ground.png" image file?
If not you probably would need it since you are using the auto property.
This may help: https://www.renpy.org/doc/html/screens. ... s#imagemap

But to answer your question, the text interpolation should work.

Re: Imagemap using interpolation

Posted: Tue Jan 28, 2020 5:29 pm
by BigBucket
I do have the image.
If I don't use the interpolation, just use "overworld_day_%s.png" it works just fine.

Edit:

Checking my variables with the Variable Viewer, time_of_day is set as ( u'day ). Maybe this is causing the issue?