Imagebutton
Forum rules
This is the right place for Ren'Py help. Please ask one question per thread, use a descriptive subject like 'NotFound error in option.rpy' , and include all the relevant information - especially any relevant code and traceback messages. Use the code tag to format scripts.
This is the right place for Ren'Py help. Please ask one question per thread, use a descriptive subject like 'NotFound error in option.rpy' , and include all the relevant information - especially any relevant code and traceback messages. Use the code tag to format scripts.
-
- Newbie
- Posts: 17
- Joined: Wed Jan 16, 2019 11:59 pm
- Contact:
Imagebutton
Hello! could you tell if there is a way to generate an imagebutton (to go in a secret menu(appers with a random chance)) in the main menu? (His location should be random too)
- IrinaLazareva
- Veteran
- Posts: 399
- Joined: Wed Jun 08, 2016 1:49 pm
- Projects: Legacy
- Organization: SunShI
- Location: St.Petersburg, Russia
- Contact:
Re: Imagebutton
screens.rpy file:
https://www.renpy.org/doc/html/other.html#renpy-random
Code: Select all
default sx = renpy.random.random()
default sy = renpy.random.random()
default sato = renpy.random.randint(0, 99)
screen main_menu():
## body of screen main_menu
if sato < 25: ### 25 means that, the button will appear with a ~ 25 percent chance
imagebutton auto 'm_%s.jpg' align(sx, sy) action Notify('Secret!')
-
- Newbie
- Posts: 17
- Joined: Wed Jan 16, 2019 11:59 pm
- Contact:
Re: Imagebutton
Thx!!!
Who is online
Users browsing this forum: snotwurm