Page 1 of 1

Adding Images in Ren'py is not working for me

Posted: Fri Jul 03, 2015 8:25 pm
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

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

Posted: Fri Jul 03, 2015 8:35 pm
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

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

Posted: Fri Jul 03, 2015 8:44 pm
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.

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

Posted: Fri Jul 03, 2015 9:53 pm
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"

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

Posted: Sat Jul 04, 2015 10:00 am
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.