help for world map and navigtion map

Cohibozz

Member
Aug 14, 2018
125
27
Hi all, i'm building for the first time in renpy.
i've studied for learn a lot of features i need but i0ve some things that i need to learn..

1) how can i do the navigation in game for move by rooms/location preset?

2) how can i do a city map to navigate with a hover image that work in different resolution?

ty a lot. who give me info, code or tutorial link
 

anne O'nymous

I'm not grumpy, I'm just coded that way.
Modder
Respected User
Donor
Jun 10, 2017
10,115
14,802
1) how can i do the navigation in game for move by rooms/location preset?
In many different ways. Among them, you can use to represent the different locations :
Code:
screen navigation:
    hbox:
       xpos 10 ypos 10
       imagebutton:
           auto "location1_%s.jpg"
           action Return( "location1" )
       [...]
       imagebutton:
           auto "locationN_%s.jpg"
           action Return( "locationN" )
Just show the "navigation" screen each time you need it, put it on an , or it on your main screen

You can use and to make each door on each location background clickable :
Code:
screen thisRoom:
    imagemap:
        auto "thisRoomBackground_%s.jpg"
        hotspot( 10, 10, 100, 100 ) action Return( "location1" )
        [...]
        hotspot( 210, 210, 100, 100 ) action Return( "locationN" )
And even with just these two variations, you can like I did, which need that you , or you can or .

And it's just three of the possibles variations of two of the possibles way to do this.


2) how can i do a city map to navigate
For this, imagemap is the better option, but still not the only one.


with a hover image that work in different resolution?
You don't have to care about this. To simplify, Ren'py always works at the resolution provided by the configuration file, then reworks the screen to fit the effective resolution. So the images will always be at the expected place, this whatever the window size is 3000x3000 or 800x640.
 

Cohibozz

Member
Aug 14, 2018
125
27
ty a lot. one info...in first example why u use return and not Call? for call room1 label?
with return don't work for me. with Call yes..ty a lot.

another info..for my navigation room menu i've used xalign yalign instead of xpos ypos.

i've done right§? it's the same? i need it on vbox in upper right monitor
 

anne O'nymous

I'm not grumpy, I'm just coded that way.
Modder
Respected User
Donor
Jun 10, 2017
10,115
14,802
ty a lot. one info...in first example why u use return and not Call?
Because it's the way I prefer. I have a better control over the game flow this way. But it's a matter of personal taste more than anything else.


another info..for my navigation room menu i've used xalign yalign instead of xpos ypos.
Both do the same. It's just that xpos/ypos works with pixels, so precisely place the object, while xalign/yalign works with percentage and place the object "around there".