Ren'Py Interactive Environment

Rappax

Newbie
Mar 19, 2018
24
2
Hey guys. I need help. I´m creating a game and I want to have some interactive clickables in the game. But I don´t really know how to add them to the game.
I mean like there´s a phone lying on the floor in the image. I want it to be clickable(Collectible). Could anybody help please ?
 

mickydoo

Fudged it again.
Game Developer
Jan 5, 2018
2,446
3,548
There are two ways of doing it, image buttons or image maps, in your case the later is more suitable.


This is the simplest example I have in my game for when you come home and click on the tv




Code:
screen television1:

    imagemap:
        ground "tvbutton_ground.jpg"
        hover "tvbutton_hover.png"
        hotspot (578, 268, 717, 323) clicked Jump("mon2TV")
The tvbutton_ground.jpg is just the background image of the scene with the TV
The tvbutton_hover.png is a full size image that is an overlay but it's just the screen of the TV in the centre of it that says click to watch. So when you you hover over it that's what it says. When you click it, it jumps to a label called mon2TV.

You get it to work by using call screen television1 when you want it.
 
  • Like
Reactions: Rappax

Rappax

Newbie
Mar 19, 2018
24
2
There are two ways of doing it, image buttons or image maps, in your case the later is more suitable.


This is the simplest example I have in my game for when you come home and click on the tv




Code:
screen television1:

    imagemap:
        ground "tvbutton_ground.jpg"
        hover "tvbutton_hover.png"
        hotspot (578, 268, 717, 323) clicked Jump("mon2TV")
The tvbutton_ground.jpg is just the background image of the scene with the TV
The tvbutton_hover.png is a full size image that is an overlay but it's just the screen of the TV in the centre of it that says click to watch. So when you you hover over it that's what it says. When you click it, it jumps to a label called mon2TV.

You get it to work by using call screen television1 when you want it.
You´re a legend. Thanks
 

mickydoo

Fudged it again.
Game Developer
Jan 5, 2018
2,446
3,548
They can be tricky pricks to work out, but once you do you go, oh fuck that was easy, and you can do it with your eyes closed after a few times.
 
  • Like
Reactions: Rappax

Rappax

Newbie
Mar 19, 2018
24
2
They can be tricky pricks to work out, but once you do you go, oh fuck that was easy, and you can do it with your eyes closed after a few times.
And when I want that hotspot dissapear after being clicked ? Do I need to use a if/else parameter with every scene ?
 

mickydoo

Fudged it again.
Game Developer
Jan 5, 2018
2,446
3,548
It only appears if you call the screen, if you dont its not there. Once its clicked the screen dissapears.
 

Porcus Dev

Engaged Member
Game Developer
Oct 12, 2017
2,582
4,690
And when I want that hotspot dissapear after being clicked ? Do I need to use a if/else parameter with every scene ?
If doesn't hide itself you can use this:
Code:
screen television1:

    imagemap:
        ground "tvbutton_ground.jpg"
        hover "tvbutton_hover.png"
        hotspot (578, 268, 717, 323) clicked Hide("television1"), Jump("mon2TV")