- Jan 12, 2019
- 55
- 90
Hi again. More help needed with Renpy coding.
I'm designing a basic phone in Renpy which allows the player to view messages. A mini phone is displayed in the top right corner. When the player clicks on the phone, it centers and enlarges it. The player can then click on the home button to turn it on.
Result:
Works fine, nice and easy. Now what I want to be able to do is have a notification icon appear on the phone if there is a message waiting for the player to read. I would like to be able to set a variable in the script file, such as
and have the phone show a notification on top of the homescreen.
I have no idea how to implement this, but I've tried simple things like:
I could obviously have a completely seperate screen for the notification and call for it within the script but I wanted to create something prettier and have it all contained in the screens file.
Any help is hugely appreciated.
I'm designing a basic phone in Renpy which allows the player to view messages. A mini phone is displayed in the top right corner. When the player clicks on the phone, it centers and enlarges it. The player can then click on the home button to turn it on.
Code:
screen mobilesmall:
imagebutton idle "gui/phone/phonemini.png" xpos 1820 ypos 20 action ShowMenu('mobile')
screen mobile:
imagemap:
idle "gui/phone/phonelarge.png" xalign 0.5 yalign 0.5
hotspot (197, 840, 75, 74) action ToggleScreen('homescreen')
screen homescreen:
imagemap:
idle "gui/phone/homescreen.png" xalign 0.5 yalign 0.5
Works fine, nice and easy. Now what I want to be able to do is have a notification icon appear on the phone if there is a message waiting for the player to read. I would like to be able to set a variable in the script file, such as
Code:
$ message = True
I have no idea how to implement this, but I've tried simple things like:
Code:
screen homescreen:
imagemap:
idle "gui/phone/homescreen.png" xalign 0.5 yalign 0.5
if $ = True:
add "gui/phone/notification.png" xpos 1174 ypos 768
Any help is hugely appreciated.