image maps porting to 6.11.0

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
tpgames
Regular
Posts: 53
Joined: Wed Jun 16, 2010 11:29 pm
Projects: Jade Universität
Contact:

image maps porting to 6.11.0

#1 Post by tpgames »

I decided to learn the new version, even though its in pre-release mode because it has features I will need when I get to that point in my code. But, will try to keep my questions to a minimum until its released. ;)

How would you write the following using the new coding rules?

I'll have several image maps. Originally, I wasn't going to use hover, etc. as I wanted the player to search and find what to do. I do like the example given, for when I do a preference image map, but it doesn't work for me here.
Thanks!

Code: Select all


label xr11xr6:
    $ result = renpy.imagemap("xr11xr6.png", "selectme.png", [
        (590, 200, 640, 250, "c11c1")
        (609, 351, 659, 401, "c11c2")
        (655, 199, 705, 249, "c11c3")
        (600, 276, 788, 326, "right")
        (368, 417, 435, 586, "down")
               ])

    if result == "c11c1":
        show c11c1.png

    if result == "c11c2":
        show c11c2.png

    if result == "c11c3":
        show c11c3.png

    if result == "right":
        jump xr21xr4

    if result == "down":
        jump xr13xr2
Kyteroo jaunting off....(won't add website until I've finished 1 Ren'Py game)
WIP: Jade Universität - A RPG puzzle game.

User avatar
PyTom
Ren'Py Creator
Posts: 16088
Joined: Mon Feb 02, 2004 10:58 am
Completed: Moonlight Walks
Projects: Ren'Py
IRC Nick: renpytom
Github: renpytom
itch: renpytom
Location: Kings Park, NY
Contact:

Re: image maps porting to 6.11.0

#2 Post by PyTom »

Declare the imagemap.

Code: Select all

screen xr11xr6:
    imagemap:
         ground "xr11xr6.png"
         hover "selectme.png"

         hotspot (590, 200, 50, 50) action Jump("cc11c1")
         hotspot (609, 351, 50, 50) action Jump("cc11c2")
         # etc.
Then call it.

Code: Select all

call screen xr11xr6
When the user clicks, Ren'Py will jump to the named label.
Supporting creators since 2004
(When was the last time you backed up your game?)
"Do good work." - Virgil Ivan "Gus" Grissom
Software > Drama • https://www.patreon.com/renpytom

vaanknight
Regular
Posts: 118
Joined: Sun Mar 28, 2010 6:01 pm
Completed: Happy Weird-Day! How a freckled fairy can save your world (Or get more freckles in the process...)"
Projects: Nameless 2D Fighting Game
Contact:

Re: image maps porting to 6.11.0

#3 Post by vaanknight »

deary me... a lot has changed, if I ported my current project to 6.11 I'd have to rewrite pretty much everything. Even tough the new functions will work this way now, will ren'py still recognize and work with the old imagemap settings?
Image

tpgames
Regular
Posts: 53
Joined: Wed Jun 16, 2010 11:29 pm
Projects: Jade Universität
Contact:

Re: image maps porting to 6.11.0

#4 Post by tpgames »

This is his answer from another thread. It doesn't answer your question specifically, but might be useful. Fortunately, my game was in its infantcy, so I didn't have anything written except the half the image map code - all of which had to be changed. :lol: Working on it now.
tpgames wrote:
I'm in the process of learning Ren'Py and making a game. This brought me to a question: Will 6.11.0 work well with code that contains older code as well as newer code? I'm trying to learn the newer code, but as documents examples are sketchy. Thats a bit hard.
The answer is yes - but. There have been a few incompatible changes in the way transforms work. You'll need to deal with those, either by enabling compatibility, or by updating your code.

The documentation is still a bit sketchy, but I wanted to get this into testing while I'm still working on it.
Kyteroo jaunting off....(won't add website until I've finished 1 Ren'Py game)
WIP: Jade Universität - A RPG puzzle game.

vaanknight
Regular
Posts: 118
Joined: Sun Mar 28, 2010 6:01 pm
Completed: Happy Weird-Day! How a freckled fairy can save your world (Or get more freckles in the process...)"
Projects: Nameless 2D Fighting Game
Contact:

Re: image maps porting to 6.11.0

#5 Post by vaanknight »

Hm, I might just have to test it myself and go back to 6.10 if it doesn't work like that. xD I have like 50 imagemaps and random python code in there, it would be a REAL pain to rewrite it all.
Image

User avatar
PyTom
Ren'Py Creator
Posts: 16088
Joined: Mon Feb 02, 2004 10:58 am
Completed: Moonlight Walks
Projects: Ren'Py
IRC Nick: renpytom
Github: renpytom
itch: renpytom
Location: Kings Park, NY
Contact:

Re: image maps porting to 6.11.0

#6 Post by PyTom »

Old imagemaps should work unchanged. If not, let me know - it's a bug, rather than something intentional.
Supporting creators since 2004
(When was the last time you backed up your game?)
"Do good work." - Virgil Ivan "Gus" Grissom
Software > Drama • https://www.patreon.com/renpytom

tpgames
Regular
Posts: 53
Joined: Wed Jun 16, 2010 11:29 pm
Projects: Jade Universität
Contact:

Re: image maps porting to 6.11.0

#7 Post by tpgames »

vaanknight wrote:Hm, I might just have to test it myself and go back to 6.10 if it doesn't work like that. xD I have like 50 imagemaps and random python code in there, it would be a REAL pain to rewrite it all.
I have 27 image maps with the old code, that I'm rewriting in the new code. However, I'm fortunate that I am a slow programmer because the other 20 image map code hasn't even been written yet. :D
Kyteroo jaunting off....(won't add website until I've finished 1 Ren'Py game)
WIP: Jade Universität - A RPG puzzle game.

Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot]