Don't know how to remove imagebuttons.
Posted: Wed Apr 13, 2022 9:12 pm
I am a novice at renpy. I have the following code as shown below. But when one of the imagebuttons takes the player to "label chief:" all the imagebuttons from "label start:" stay. How do I tell imagebuttons to go away when I'm done with them. Better yet, is there a handy code that clears the screen of all images before a new page or "label" appears. As I'm a novice, who has spent days on this problem, an example of the solution code would be much appreciated.
# Big Game Example ##################################################
# Define and declare the color of each character. ##################
define c = Character("Chief",color="#CC0000")
define y = Character("You",color="#0066CC")
define d = Character("Doctor Deeth",color="#CC0000")
define s = Character("Officer Seen",color="#CC0000")
image office = "your_office_background.png"
# New place, room, or container. ####################################
label start:
scene your_office_background
show screen something
"Welcome!"
screen something:
# real buttons here on top...
imagebutton:
idle "your_conference_door_closed.png"
hover "your_conference_door_open.png"
xpos 75 ypos 77
action Jump('test')
imagebutton:
idle "your_chief_door_closed.png"
hover "your_chief_door_open.png"
xpos 325 ypos 75
action Jump('chief')
imagebutton:
idle "your_lounge_door_closed.png"
hover "your_lounge_door_open.png"
xpos 562 ypos 70
action Jump('test')
imagebutton:
idle "your_shooting_door_closed.png"
hover "your_shooting_door_open.png"
xpos 803 ypos 75
action Jump('test')
imagebutton:
idle "your_parking_door_closed.png"
hover "your_parking_door_open.png"
xpos 1040 ypos 73
action Jump('test')
imagebutton:
idle "your_phone.png"
hover "your_phone.png"
xpos 400 ypos 340
action Jump('test')
imagebutton:
idle "your_mug.png"
hover "your_mug.png"
xpos 535 ypos 353
action Jump('test')
imagebutton:
idle "your_todo.png"
hover "your_todo.png"
xpos 625 ypos 409
action Jump('test')
imagebutton:
idle "your_computer.png"
hover "your_computer.png"
xpos 715 ypos 280
action Jump('test')
imagebutton:
idle "your_trash.png"
hover "your_trash.png"
xpos 951 ypos 490
action Jump('test')
# drawers...
imagebutton:
idle "your_drawer_closed_left.png"
hover "your_drawer_open_left.png"
xpos 350 ypos 571
action Jump('test')
imagebutton:
idle "your_drawer_closed_left.png"
hover "your_drawer_open_left.png"
xpos 350 ypos 490
action Jump('test')
imagebutton:
idle "your_drawer_closed_right.png"
hover "your_drawer_open_right.png"
xpos 810 ypos 571
action Jump('test')
imagebutton:
idle "your_drawer_closed_right.png"
hover "your_drawer_open_right.png"
xpos 810 ypos 490
action Jump('test')
# New place, room, or container. ####################################
label test:
"Test text text text text text!"
# New place, room, or container. ####################################
label chief:
scene s1chiefsoffice
show s1chiefatdesk at truecenter
c "Welcome, Detective."
menu:
"It's good to be here. I welcome the opportunity to help the community.":
jump whatever
"It's good to be here. I am looking forard to to working my first case.":
jump whatever
# New place, room, or container. ####################################
label whatever:
y "Good to be here. I-"
c "Fine. Fine. Enough with the chit-chat. Let's get to work!"
c "Early this morning there was a stabbing in Stickville!"
c "We have the suspect in custody. He's covered with the victim's blood."
c "We also have two eye-witnesses and a solid motive."
c "what I need from you is..."
c "One: find the murder weapon."
c "And two: confirm that the cause of death was 'stabbing'."
c "Come back to my office as soon as you have compleaed both tasks."
y "Okay. Thank you."
jump yourdeskfirsttime
# Return ends the game. ###############################################
return
# Big Game Example ##################################################
# Define and declare the color of each character. ##################
define c = Character("Chief",color="#CC0000")
define y = Character("You",color="#0066CC")
define d = Character("Doctor Deeth",color="#CC0000")
define s = Character("Officer Seen",color="#CC0000")
image office = "your_office_background.png"
# New place, room, or container. ####################################
label start:
scene your_office_background
show screen something
"Welcome!"
screen something:
# real buttons here on top...
imagebutton:
idle "your_conference_door_closed.png"
hover "your_conference_door_open.png"
xpos 75 ypos 77
action Jump('test')
imagebutton:
idle "your_chief_door_closed.png"
hover "your_chief_door_open.png"
xpos 325 ypos 75
action Jump('chief')
imagebutton:
idle "your_lounge_door_closed.png"
hover "your_lounge_door_open.png"
xpos 562 ypos 70
action Jump('test')
imagebutton:
idle "your_shooting_door_closed.png"
hover "your_shooting_door_open.png"
xpos 803 ypos 75
action Jump('test')
imagebutton:
idle "your_parking_door_closed.png"
hover "your_parking_door_open.png"
xpos 1040 ypos 73
action Jump('test')
imagebutton:
idle "your_phone.png"
hover "your_phone.png"
xpos 400 ypos 340
action Jump('test')
imagebutton:
idle "your_mug.png"
hover "your_mug.png"
xpos 535 ypos 353
action Jump('test')
imagebutton:
idle "your_todo.png"
hover "your_todo.png"
xpos 625 ypos 409
action Jump('test')
imagebutton:
idle "your_computer.png"
hover "your_computer.png"
xpos 715 ypos 280
action Jump('test')
imagebutton:
idle "your_trash.png"
hover "your_trash.png"
xpos 951 ypos 490
action Jump('test')
# drawers...
imagebutton:
idle "your_drawer_closed_left.png"
hover "your_drawer_open_left.png"
xpos 350 ypos 571
action Jump('test')
imagebutton:
idle "your_drawer_closed_left.png"
hover "your_drawer_open_left.png"
xpos 350 ypos 490
action Jump('test')
imagebutton:
idle "your_drawer_closed_right.png"
hover "your_drawer_open_right.png"
xpos 810 ypos 571
action Jump('test')
imagebutton:
idle "your_drawer_closed_right.png"
hover "your_drawer_open_right.png"
xpos 810 ypos 490
action Jump('test')
# New place, room, or container. ####################################
label test:
"Test text text text text text!"
# New place, room, or container. ####################################
label chief:
scene s1chiefsoffice
show s1chiefatdesk at truecenter
c "Welcome, Detective."
menu:
"It's good to be here. I welcome the opportunity to help the community.":
jump whatever
"It's good to be here. I am looking forard to to working my first case.":
jump whatever
# New place, room, or container. ####################################
label whatever:
y "Good to be here. I-"
c "Fine. Fine. Enough with the chit-chat. Let's get to work!"
c "Early this morning there was a stabbing in Stickville!"
c "We have the suspect in custody. He's covered with the victim's blood."
c "We also have two eye-witnesses and a solid motive."
c "what I need from you is..."
c "One: find the murder weapon."
c "And two: confirm that the cause of death was 'stabbing'."
c "Come back to my office as soon as you have compleaed both tasks."
y "Okay. Thank you."
jump yourdeskfirsttime
# Return ends the game. ###############################################
return