Bum_McFluff wrote: ↑Tue May 11, 2021 3:57 am
That hasn't made any difference. What do I need to do differently with the image file?
Do I use something like:
Code: Select all
scene hotelExterior():
"images/bg/hotel_exterior.png"
or
Code: Select all
screen hotelExterior():
add "images/bg/hotel_exterior.png"
or what? How do I define the background images if not like this?
Thank you for your time and patience.
Forget about screens for now. You don't need any screens for this. The language in screens is somewhat different from that used in the main renpy script. Focus on main renpy script for now.
We are now just going to use 'scene' and 'show'. Both render images.
You
can define an image like this
image anynameyouwant = "bg/hotel_exterior.png"
obs! don't include 'images/' in the name of the path.
but you really
don't have to do that, so as a general rule you should
not define your images. Renpy already handles that.
If you have a file named "hotel_exterior.png" somewhere in your folder "images" renpy will find that file, if you use the file name without the suffix, in this case; hotel_exterior.
scene hotel_exterior
or
show hotel_exterior
both commands will render the image, without the image having been defined.
'scene' is useful for backgrounds since that is the first image you want to be rendered and it hides previously used images.
Take the code I wrote earlier, remove the labels I used earlier and put the code directly under label start.
'label start:' is where the program starts rendering stuff when you go from the main page to the game itself.
Don't define anything. Just have the code below.
Provided you have image files
"hotel_exterior.png"
"hotel_reception.png" and
"hotelmanager_full.png"
somewhere in the game's "image" folder, even if it is in a sub-folder, renpy will find the image files,
and the code below should work.
the game will end at the 'return' command
Code: Select all
label start:
scene hotel_exterior
"Well, this looks like the hotel they mentioned."
show hotelmanager_full
"Welcome to Hotel California!"
scene hotel_reception
show hotelmanager_full
"You can check in any time.
return
If you get this code to run as it stands then you can start adding stuff. Don't do anything different until you see this code working.