Random Main Menu Background
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.
Random Main Menu Background
I've tried myself and failed with this. I'm trying to implement it so the main menu background is randomly chosen each time out of several. Any idea how to do this in screens?
Re: Random Main Menu Background
How do you implement the main menu background in screens? Something with imagemap?
If so, just an idea, store the ground, idle, hover images in variables with fixed initial values.
Then pick a random number from 1 to as many as the available background images, say 5.
Then change the grounds and hovers according to the result
In the imagemap part, the ground and hover image are declared like so
Something like this?
If so, just an idea, store the ground, idle, hover images in variables with fixed initial values.
Code: Select all
screen main_menu:
$ grounds = "map_ground.jpg"
$ hovers = "map_hover.jpg"
Code: Select all
$ random = renpy.random.randint(1,5)
Code: Select all
if(random == 2):
$ grounds = "map2_ground.jpg"
$ hovers = "map2_hover.jpg"
elif(random == 3):
$ grounds = "map3_ground.jpg"
$ hovers = "map3_hover.jpg"
elif(random == 4):
$ grounds = "map4_ground.jpg"
$ hovers = "map4_hover.jpg"
elif(random == 5):
$ grounds = "map5_ground.jpg"
$ hovers = "map5_hover.jpg"
Code: Select all
imagemap:
ground grounds
hover hovers
# hotspots...
I'm sorry if I'm too stupid, but I can't learn to walk on my own
Who is online
Users browsing this forum: Ahrefs [Bot], Bing [Bot], eleloyce, Google [Bot]