Tutorial Ren'Py Navagation Menu In Ren'Py

mickydoo

Fudged it again.
Game Developer
Jan 5, 2018
2,446
3,547
Hello, I am learning how use Ren'Py. Ive got the intro of my game done but before I go any further I want to make an menu/map like in Big Brother that can be clicked on to visit different locations of the house/world. From what Ive read I need to make a hot spot so I can click on the image of say the bedroom to go there. Ive read three different "tutorials" on making one but they are all years apart in there making and all use slightly different ways and none of them work for me.

In a tut using a solar system it says -
hotspot (62, 399, 90, 91) clicked Jump("mercury")

Basically I want to know what to put after hotspot (62, 399, 90, 91)

So if I have
image mb = "master bedroom.jpg" when I click on the hot spot I want to go to the bedroom.

Eg hotspot (62, 399, 90, 91) clicked Jump("mb")
But that does not work.

Or am I going about the whole thing the wrong way?
 

anne O'nymous

I'm not grumpy, I'm just coded that way.
Modder
Respected User
Donor
Jun 10, 2017
10,167
14,885
[...] I want to make an menu/map like in Big Brother that can be clicked on to visit different locations of the house/world.
First way to do it, :
Code:
screen myScreen:
   imagemap:
       idle "master bedroom.jpg"
       hotspot (62, 399, 90, 91) action Jump( "mb" )
Second way to do it, :
Code:
screen myScreen:
   imagebutton:
       posx 62
       posy 399
       idle "myButton.png"
       action Jump( "mb" )
 

Palanto

Active Member
Game Developer
Oct 4, 2017
964
1,839
Well if all you want is the answer to your last question then you need to put the labelname of your master bedroom after the Jump...

clicked Jump("Master Bedroom Labelname")

So if your Master Bedroom has the label set like this:

label masterbedroom:

then you'd need to write:

clicked Jump("masterbedroom")

if it's:

label mb:

then you'd need to write:

clicked Jump("mb")

But I'd suggest reading the links AON posted up there ;)
 
  • Like
Reactions: mickydoo

mickydoo

Fudged it again.
Game Developer
Jan 5, 2018
2,446
3,547
Yea I am reading and reading lol, Ill get there I am an determined individual, never even heard of RenPy til I joined this forum and Ive done alright to date, this is a bit more complicated though, I'll get there (hopefully) I got nothing better to do anyway :D
 
  • Like
Reactions: Palanto

anne O'nymous

I'm not grumpy, I'm just coded that way.
Modder
Respected User
Donor
Jun 10, 2017
10,167
14,885
clicked Jump("Master Bedroom Labelname")
Just a remark (obviously for him, not you, because you know it) about "clicked" :
It will works, but it's now really outdated. Nowadays it's better to replace it by "action" like in the examples I gave. It will do the same thing, and you'll be less confused when finding more recent code.
 
  • Like
Reactions: Palanto

Palanto

Active Member
Game Developer
Oct 4, 2017
964
1,839
Just a remark (obviously for him, not you, because you know it) about "clicked" :
It will works, but it's now really outdated. Nowadays it's better to replace it by "action" like in the examples I gave. It will do the same thing, and you'll be less confused when finding more recent code.
True should have mentioned that myself X_x
 

anne O'nymous

I'm not grumpy, I'm just coded that way.
Modder
Respected User
Donor
Jun 10, 2017
10,167
14,885
True should have mentioned that myself X_x
You probably didn't noticed it, at least not consciously. Part of your brain was saying, "it will works like this", and shut up the part saying, "yeah, I came back in time, I'm younger" :) It's always tricky to give example in case like this, because we naturally tend to reuse what we just saw.
 
  • Like
Reactions: Palanto

Palanto

Active Member
Game Developer
Oct 4, 2017
964
1,839
I seriously didn't notice it :D Well I should pay more attention to the details next time I try to help :D
 

Fasder

Open bob
Game Developer
Dec 5, 2017
1,294
5,002
Like people have pointed out earlier you got imagemaps or buttons to choose from. I use imagebuttons for my game, my GUI is very similar to Big Brother's, textbuttons would work too or just plain 'ol buttons.
I've never attempted to use an imagemap as they seem to be really annoying to set up. You can also get the same effect using imagebuttons, they can also add some freedom.

I would also advice to look into vbox, hbox and viewport, all very useful functions in Ren'Py.

Good luck!
 

mickydoo

Fudged it again.
Game Developer
Jan 5, 2018
2,446
3,547
I do believe I got it to work, fingers crossed i don't break it. Cheers fella's appreciate the help :D