[Solved] Regards image path with renpy.show() function

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
andriodmactemporary
Regular
Posts: 27
Joined: Mon Jan 25, 2021 5:35 pm
Contact:

[Solved] Regards image path with renpy.show() function

#1 Post by andriodmactemporary »

To show an image we use renpy.show(bg beach") where "bg beach" will be defined as:

image bg beach:
"beach.jpg".

But how to use renpy.show() with directly giving image path to the function. Like,

I have image "Pic.jpg" in game/images folder I have tried renpy.show("game/images/Pic.jpg"), renpy.show("images/Pic.jpg"), and renpy.show("Pic.jpg") but it is not showing the image it is only showing the path I entered in renpy.show() function.

Thanks
Last edited by andriodmactemporary on Tue Aug 03, 2021 5:55 am, edited 1 time in total.

User avatar
bonnie_641
Regular
Posts: 133
Joined: Sat Jan 13, 2018 10:57 pm
Projects: Código C.O.C.I.N.A.
Deviantart: rubymoonlily
Contact:

Re: Regards image path with renpy.show() function

#2 Post by bonnie_641 »

andriodmactemporary wrote: Sun Aug 01, 2021 12:59 pm how to use renpy.show()
You don't need to define the images, since Ren'py detects all the images you add in the "images" folder.

There are different ways to call them in the game (in label)
1.- show image_name with effect_name
2.- $ renpy.show("image_name_without_extension")

Code: Select all

# can be any label
# If your image is "pic.png" (and you save it in the "images" folder), you write this:
label start:
    $ renpy.show ("pic")
    "Test renpy.show"
    return
I speak and write in Spanish. I use an English-Spanish translator to express myself in this forum. If I make any mistakes, please forgive me.
I try my best to give an answer according to your question. :wink:

andriodmactemporary
Regular
Posts: 27
Joined: Mon Jan 25, 2021 5:35 pm
Contact:

Re: Regards image path with renpy.show() function

#3 Post by andriodmactemporary »

Thanks, it worked, is there a way to specify image resolution with renpy.show().

User avatar
bonnie_641
Regular
Posts: 133
Joined: Sat Jan 13, 2018 10:57 pm
Projects: Código C.O.C.I.N.A.
Deviantart: rubymoonlily
Contact:

Re: Regards image path with renpy.show() function

#4 Post by bonnie_641 »

andriodmactemporary wrote: Mon Aug 02, 2021 6:04 am Thanks, it worked, is there a way to specify image resolution with renpy.show().
I tried many ways and the only one that worked requires specifying the image path XD.

Code: Select all

image pic = im.Scale("images/pic.png", 300, 300) # <---- 300 x 300 pixels

label start:
    $ renpy.show("pic") 
    "Test to show image with specific size."
    return
I speak and write in Spanish. I use an English-Spanish translator to express myself in this forum. If I make any mistakes, please forgive me.
I try my best to give an answer according to your question. :wink:

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: Regards image path with renpy.show() function

#5 Post by PyTom »

You don't want to use im.Scale - it's been undocumented for a bit now.

Your best bet is to use renpy.show with an at_list:

Code: Select all

$ renpy.show("pic", at_list=[ Transform(size=(300, 300)) ])
Note that using renpy.show usually means you're doing something wrong, as it doesn't allow images to be predicted.
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

andriodmactemporary
Regular
Posts: 27
Joined: Mon Jan 25, 2021 5:35 pm
Contact:

Re: Regards image path with renpy.show() function

#6 Post by andriodmactemporary »

PyTom wrote: Mon Aug 02, 2021 8:24 pm You don't want to use im.Scale - it's been undocumented for a bit now.

Your best bet is to use renpy.show with an at_list:

Code: Select all

$ renpy.show("pic", at_list=[ Transform(size=(300, 300)) ])
Note that using renpy.show usually means you're doing something wrong, as it doesn't allow images to be predicted.
Thanks, Creator It worked, Also, could you please update the documentation.

andriodmactemporary
Regular
Posts: 27
Joined: Mon Jan 25, 2021 5:35 pm
Contact:

Re: Regards image path with renpy.show() function

#7 Post by andriodmactemporary »

bonnie_641 wrote: Mon Aug 02, 2021 7:49 pm
andriodmactemporary wrote: Mon Aug 02, 2021 6:04 am Thanks, it worked, is there a way to specify image resolution with renpy.show().
I tried many ways and the only one that worked requires specifying the image path XD.

Code: Select all

image pic = im.Scale("images/pic.png", 300, 300) # <---- 300 x 300 pixels

label start:
    $ renpy.show("pic") 
    "Test to show image with specific size."
    return
Thanks for your time.

User avatar
bonnie_641
Regular
Posts: 133
Joined: Sat Jan 13, 2018 10:57 pm
Projects: Código C.O.C.I.N.A.
Deviantart: rubymoonlily
Contact:

Re: Regards image path with renpy.show() function

#8 Post by bonnie_641 »

PyTom wrote: Mon Aug 02, 2021 8:24 pm

Code: Select all

$ renpy.show("pic", at_list=[ Transform(size=(300, 300)) ])
Where is it in the documentation? I didn't see it anywhere XD
Is there any way to see it in the source code? any command?

Thank you. I learned something new (I will rectify the errors I have in my game).
andriodmactemporary wrote: Tue Aug 03, 2021 5:54 am Thanks for your time.
You are welcome :D
I speak and write in Spanish. I use an English-Spanish translator to express myself in this forum. If I make any mistakes, please forgive me.
I try my best to give an answer according to your question. :wink:

User avatar
Ocelot
Lemma-Class Veteran
Posts: 2376
Joined: Tue Aug 23, 2016 10:35 am
Github: MiiNiPaa
Discord: MiiNiPaa#4384
Contact:

Re: Regards image path with renpy.show() function

#9 Post by Ocelot »

bonnie_641 wrote: Tue Aug 03, 2021 1:52 pm Where is it in the documentation? I didn't see it anywhere XD
Is there any way to see it in the source code? any command?

Thank you. I learned something new (I will rectify the errors I have in my game).
https://www.renpy.org/doc/html/trans_tr ... #Transform
< < insert Rick Cook quote here > >

Post Reply

Who is online

Users browsing this forum: Bing [Bot]