Imagemap using interpolation

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
BigBucket
Regular
Posts: 26
Joined: Wed Aug 21, 2019 9:19 pm
Contact:

Imagemap using interpolation

#1 Post by BigBucket » Tue Jan 28, 2020 5:05 pm

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?

User avatar
Angelo Seraphim
Regular
Posts: 32
Joined: Tue May 21, 2019 8:00 am
Completed: Enamored Risks (NaNoReNo 2020)
Projects: 616 Charagma
Organization: GLSUoA
Deviantart: glsuoa
itch: glsuoa
Location: London, UK
Discord: Just A Concept#9599
Contact:

Re: Imagemap using interpolation

#2 Post by Angelo Seraphim » Tue Jan 28, 2020 5:20 pm

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.
Image

BigBucket
Regular
Posts: 26
Joined: Wed Aug 21, 2019 9:19 pm
Contact:

Re: Imagemap using interpolation

#3 Post by BigBucket » Tue Jan 28, 2020 5:29 pm

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?

Post Reply

Who is online

Users browsing this forum: Bing [Bot]