Hey, so recently I've been working a lot on my VN but everytime I add and image I have to declare it in the init before the start label or otherwise I get an error when loading the game or I get a white screen with the name of the image.
Since going through the motion of declaring first in a LOOOONG list of declarations I already have, is there a way to use images without declaring them first?
I know this is a total newbie question and it should be pretty simple but I can't really find the answer to it by myself, or renpy just doens't work that way.
Thanks in advance!
[SOLVED] Using Images in Show and Scene statements without declaring them in Init.
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] Using Images in Show and Scene statements without declaring them in Init.
Last edited by Jg119 on Wed Aug 19, 2020 11:09 pm, edited 1 time in total.
Re: Using Images in Show and Scene statements without declaring them in Init.
Images are auto-defined since like... years ago. https://www.renpy.org/doc/html/displayi ... -directory
- Remix
- Eileen-Class Veteran
- Posts: 1628
- Joined: Tue May 30, 2017 6:10 am
- Completed: None... yet (as I'm still looking for an artist)
- Projects: An un-named anime based trainer game
- Contact:
Re: Using Images in Show and Scene statements without declaring them in Init.
You can use the expression keyword...
Use the as keyword to set the images tag (for hiding later)
Use the as keyword to set the images tag (for hiding later)
Code: Select all
scene expression "images/backgrounds/my_pic.png"
show expression "images/backgrounds/my_pic2.png" as piccy2
"dialogue"
hide piccy2
Frameworks & Scriptlets:
- Speech Bubble dialogue system
- Multiple Notify with ATL and history
- (WIP) Radial Masking - needs updating to use Shader
- 7.4 - Smooth Tinting using ATL and matrixcolor
- Several other repositories there too
- qirien
- Miko-Class Veteran
- Posts: 541
- Joined: Thu Jul 31, 2003 10:06 pm
- Organization: Metasepia Games
- Deviantart: qirien
- Github: qirien
- itch: qirien
- Location: New Mexico, USA
- Discord: qirien
- Contact:
Re: Using Images in Show and Scene statements without declaring them in Init.
As long as they are in a subdirectory called "images", Ren'py should find them for you automatically.
Re: Using Images in Show and Scene statements without declaring them in Init.
Thanks guys, I'll try this out and see if I can get the expected results. As Philat says, I read that the images were supposed to be auto-defined but it has never work for me, is it perhaps because I use the path from "imaes/..." and not the whole "game/images/..." ?
The expression keyword is a nice workaround, so far has worked like a charm. Thanks Remix!
The expression keyword is a nice workaround, so far has worked like a charm. Thanks Remix!
- qirien
- Miko-Class Veteran
- Posts: 541
- Joined: Thu Jul 31, 2003 10:06 pm
- Organization: Metasepia Games
- Deviantart: qirien
- Github: qirien
- itch: qirien
- Location: New Mexico, USA
- Discord: qirien
- Contact:
Re: Using Images in Show and Scene statements without declaring them in Init.
All of your files for your game should be under the "game" folder (so, yes, it should be game/images). The other folders are for Ren'Py stuff.
Re: Using Images in Show and Scene statements without declaring them in Init.
Okay I think I got it, seems it was a mistake in how I was telling renpy what image to use. Looking carefully at the renpy doc, i realized that i had to use the name of the image with no quotation marks, all lower case, and use the spaces as normal instead of adding lower bar in the spaces "_", the problem I had was that some of my images had names that conflicted wit the repny syntaxis like the word "scene" or "jump". In this case there was no need to add the "game/images/XXX". Thanks for the help!
Who is online
Users browsing this forum: Google [Bot]