Hello,
I'm relatively new to Ren'Py, but I have a little bit of experience in javascript and python. Anyway, I was wondering how I can add a picture to the main menu screen (not the static background image you can configure in screens.rpy). I want to add a picture to the foreground, not just the background, much like how you can call an image in-game in the script.rpy using the show or image command. I also want to be able to have the pictures transition into the main menu as you open the game using a transform/transition (just like Doki Doki Literature Club!)--I already have the code for the image transformation, I just need to know how to apply it to the main menu screen.
I've been looking around online for help but to no avail. Any help would be very much appreciated. Thank you so much!
[SOLVED] Adding displayables to main menu screen
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.
[SOLVED] Adding displayables to main menu screen
Last edited by Izzy on Tue Apr 17, 2018 4:29 am, edited 2 times in total.
- Qlara
- Regular
- Posts: 80
- Joined: Fri Nov 28, 2014 10:22 am
- Completed: Carmilla
- Skype: kantonija
- itch: visualgothic
- Location: Berlin
- Contact:
Re: Adding displayables to main menu screen
You can add images with
just below
in the screens file under screen main_menu (assuming you are still using this).
For the transition check out your options file. There's a section where transitions are defined, you could try playing with that.
Code: Select all
add "images/your_image.png"
Code: Select all
add gui.main_menu_background
For the transition check out your options file. There's a section where transitions are defined, you could try playing with that.
- Imperf3kt
- Lemma-Class Veteran
- Posts: 3791
- Joined: Mon Dec 14, 2015 5:05 am
- itch: Imperf3kt
- Location: Your monitor
- Contact:
Re: Adding displayables to main menu screen
For a menu like the one in DDLC, you'll want to look into the before_main_menu label documented in the documentation.
Warning: May contain trace amounts of gratuitous plot.
pro·gram·mer (noun) An organism capable of converting caffeine into code.
Current project: GGD Mentor
Twitter
pro·gram·mer (noun) An organism capable of converting caffeine into code.
Current project: GGD Mentor
Re: Adding displayables to main menu screen
Hey Qlara,
Thank you for your response, now I know how to add images to the main menu!
There is one more problem, however. I've defined a transformation, fly:
transform fly(x):
zoom x * 0.5
parallel:
ease 1.5 zoom x
And this is what I'm trying to do in screens.rpy, under 'add gui.main_menu_background':
add "images/izzymenu.png":
fly(0.5)
I'm trying to apply a transformation to the image, but I'm not sure where to place the code that defines the transformation. I've tried putting it in all of the rpy files, including screens.rpy. When I try to apply the transformation to the image, I only get a syntax error when I start my game.
Again, thank you for all your help!
Thank you for your response, now I know how to add images to the main menu!
There is one more problem, however. I've defined a transformation, fly:
transform fly(x):
zoom x * 0.5
parallel:
ease 1.5 zoom x
And this is what I'm trying to do in screens.rpy, under 'add gui.main_menu_background':
add "images/izzymenu.png":
fly(0.5)
I'm trying to apply a transformation to the image, but I'm not sure where to place the code that defines the transformation. I've tried putting it in all of the rpy files, including screens.rpy. When I try to apply the transformation to the image, I only get a syntax error when I start my game.
Again, thank you for all your help!
Re: Adding displayables to main menu screen
To apply a transform you need to use the keyword "at"
So try this:
Syntax error basically means the code you put in doesn't conform to the language's format, and usually references which line the syntax error is (I think). In this instance - providing you've done the indentation right, your transform can live in any file.
So try this:
Code: Select all
add "images/izzymenu.png" at fly(0.5)
[SOLVED] Adding displayables to main menu screen
Aaaaah!! I just realized my mistake. Thank you so much for your help!kivik wrote: ↑Tue Apr 17, 2018 4:15 am To apply a transform you need to use the keyword "at"
So try this:Syntax error basically means the code you put in doesn't conform to the language's format, and usually references which line the syntax error is (I think). In this instance - providing you've done the indentation right, your transform can live in any file.Code: Select all
add "images/izzymenu.png" at fly(0.5)
Who is online
Users browsing this forum: Google [Bot]