How to combine areas?

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
bambino358
Regular
Posts: 26
Joined: Sat Apr 27, 2019 7:17 am
Contact:

How to combine areas?

#1 Post by bambino358 » Wed Dec 04, 2019 1:38 pm

Is it possible to combine areas?

I want player to follow the path (minigame) you can see it on the image. If the player move the cursor outside of the area, minigame is closed.

I'm trying to do it with mousearea but I don't know how to combine more areas to "describe" whole path.

This is what I have:

Code: Select all

screen zamek1:
    zorder 4
    modal True
    add "dress_up/20/zamek1_background.webp"
    
        imagemap:
            ground "dress_up/20/bludiste1_ground.png"
            hover "dress_up/20/bludiste1_hover.png"
        mousearea:
            area [45, 470, 232, 120]
            hovered [NullAction()]
            unhovered [Hide("zamek1"), SetVariable("zamekpokrok", 0)]
        mousearea:
            area [276, 515, 1008, 30]
            hovered [NullAction()]
            unhovered [Hide("zamek1"), SetVariable("zamekpokrok", 0)]
This doesn't work. When I place the pointer outside of the first mousearea unhovered is activated even if the pointer is in the "second" mousearea.

So... is there a way ho to combine more mouseareas??

I think this can be also solution but I don't know how to implement it...

"The Mousearea screen language statement now respects the focus_mask style property, making it possible to have non-rectangular mouseareas."

Thank you
Attachments
bludiste1_ground.png

bambino358
Regular
Posts: 26
Joined: Sat Apr 27, 2019 7:17 am
Contact:

Re: How to combine areas?

#2 Post by bambino358 » Wed Dec 04, 2019 3:14 pm

OK I think I figured it out. Instead of mousearea I used imagebutton with focus_mask and it works great.

Post Reply

Who is online

Users browsing this forum: mold.FF