Adding Images in Ren'py is not working for me

Discuss how to use the Ren'Py engine to create visual novels and story-based games. New releases are announced in this section.
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.
Post Reply
Message
Author
User avatar
fata01
Newbie
Posts: 3
Joined: Fri Jul 03, 2015 8:14 pm
Contact:

Adding Images in Ren'py is not working for me

#1 Post by fata01 »

Hello, I am new to this forum and to Ren'py. I have been trying to practice using the tutorial and also trying to follow each step to learn in general what can be done with the program. Unfortunately I have come across a problem that I cannot solve on my own. I have been trying to show an image in the game. I have done it as the tutorial showed and I have also looked at different solutions on the forum so I would not have to bother anyone here. I could not find a solution to my problem and I know 100% I am not making any noticeable mistakes when I input the code. I am using the 6.99.4 version of the program. All other codes seem to work, but with the image I am getting a problem that from what I have been reading, is not so rare, but the solutions are different for each case I have seen. Ren'py keeps telling me it cannot find the image that I try to show, even though it is in the images folder.

This is the code I used:

# You can place the script of your game in this file.

# Declare images below this line, using the image statement.

image mon = "mark_of_ninja.jpg"
image intro = "empire.png"


# Declare characters used by this game.
define e = Character('Eileen', color="#c8ffc8")
define l = Character('Luciano', color="#c8ffc8")

# The game starts here.
label start:

show intro

show mon

l "I beat you to it AI"

e "You've created a new Ren'Py game."

e "Once you add a story, pictures, and music, you can release it to the world!"

e "Who was that? Game GOD? Is that you?"

l "Who do you think would make such a cheesy line? Of course it´s me."

return


Thanks to anyone who might be able to help me out. :o

User avatar
PyTom
Ren'Py Creator
Posts: 16088
Joined: Mon Feb 02, 2004 10:58 am
Completed: Moonlight Walks
Projects: Ren'Py
IRC Nick: renpytom
Github: renpytom
itch: renpytom
Location: Kings Park, NY
Contact:

Re: Adding Images in Ren'py is not working for me

#2 Post by PyTom »

Did you place the images in the images directory. If so, you don't need image statements - Ren'Py will automatically define an image that is the file name pushed down to lower case.

For example, if you have images/mark_of_ninja.jpg, then you can just use:

Code: Select all

show mark_of_ninja
Supporting creators since 2004
(When was the last time you backed up your game?)
"Do good work." - Virgil Ivan "Gus" Grissom
Software > Drama • https://www.patreon.com/renpytom

User avatar
fata01
Newbie
Posts: 3
Joined: Fri Jul 03, 2015 8:14 pm
Contact:

Re: Adding Images in Ren'py is not working for me

#3 Post by fata01 »

That worked perfectly. I guess the tutorial is outdated and not 100% accurate for this version of the game.


Thank you very much for your assistance.

User avatar
trooper6
Lemma-Class Veteran
Posts: 3712
Joined: Sat Jul 09, 2011 10:33 pm
Projects: A Close Shave
Location: Medford, MA
Contact:

Re: Adding Images in Ren'py is not working for me

#4 Post by trooper6 »

fata01 wrote:Ren'py keeps telling me it cannot find the image that I try to show, even though it is in the images folder.

This is the code I used:

# You can place the script of your game in this file.

# Declare images below this line, using the image statement.

image mon = "mark_of_ninja.jpg"
image intro = "empire.png"
The older way still works, you just have to declare the images properly.
If the images are in the images folder, then you have to declare them like so:
image mon = "images/mark_of_ninja.jpg"
image intro = "images/empire.png"
A Close Shave:
*Last Thing Done (Aug 17): Finished coding emotions and camera for 4/10 main labels.
*Currently Doing: Coding of emotions and camera for the labels--On 5/10
*First Next thing to do: Code in all CG and special animation stuff
*Next Next thing to do: Set up film animation
*Other Thing to Do: Do SFX and Score (maybe think about eye blinks?)
Check out My Clock Cookbook Recipe: http://lemmasoft.renai.us/forums/viewto ... 51&t=21978

User avatar
fata01
Newbie
Posts: 3
Joined: Fri Jul 03, 2015 8:14 pm
Contact:

Re: Adding Images in Ren'py is not working for me

#5 Post by fata01 »

Thank you so much for your help.

The answer was right there in front of me and I just could not see it.

I appreciate the fact that you took some time to give me a hand.

Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot], Google [Bot], Kocker