[Solved] Regards image path with renpy.show() function
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.
-
- Regular
- Posts: 27
- Joined: Mon Jan 25, 2021 5:35 pm
- Contact:
[Solved] Regards image path with renpy.show() function
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
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.
- 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
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.
I try my best to give an answer according to your question.
-
- Regular
- Posts: 27
- Joined: Mon Jan 25, 2021 5:35 pm
- Contact:
Re: Regards image path with renpy.show() function
Thanks, it worked, is there a way to specify image resolution with renpy.show().
- 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
I tried many ways and the only one that worked requires specifying the image path XD.andriodmactemporary wrote: ↑Mon Aug 02, 2021 6:04 am Thanks, it worked, is there a way to specify image resolution with renpy.show().
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.
I try my best to give an answer according to your question.
- PyTom
- Ren'Py Creator
- Posts: 16093
- 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
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:
Note that using renpy.show usually means you're doing something wrong, as it doesn't allow images to be predicted.
Your best bet is to use renpy.show with an at_list:
Code: Select all
$ renpy.show("pic", at_list=[ Transform(size=(300, 300)) ])
Supporting creators since 2004
(When was the last time you backed up your game?)
"Do good work." - Virgil Ivan "Gus" Grissom(When was the last time you backed up your game?)
Software > Drama • https://www.patreon.com/renpytom
-
- Regular
- Posts: 27
- Joined: Mon Jan 25, 2021 5:35 pm
- Contact:
Re: Regards image path with renpy.show() function
Thanks, Creator It worked, Also, could you please update the documentation.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:
Note that using renpy.show usually means you're doing something wrong, as it doesn't allow images to be predicted.Code: Select all
$ renpy.show("pic", at_list=[ Transform(size=(300, 300)) ])
-
- Regular
- Posts: 27
- Joined: Mon Jan 25, 2021 5:35 pm
- Contact:
Re: Regards image path with renpy.show() function
Thanks for your time.bonnie_641 wrote: ↑Mon Aug 02, 2021 7:49 pmI tried many ways and the only one that worked requires specifying the image path XD.andriodmactemporary wrote: ↑Mon Aug 02, 2021 6:04 am Thanks, it worked, is there a way to specify image resolution with renpy.show().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
- 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
Where is it in the documentation? I didn't see it anywhere XDPyTom wrote: ↑Mon Aug 02, 2021 8:24 pmCode: Select all
$ renpy.show("pic", at_list=[ Transform(size=(300, 300)) ])
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).
You are welcome
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.
I try my best to give an answer according to your question.
- Ocelot
- Lemma-Class Veteran
- Posts: 2400
- Joined: Tue Aug 23, 2016 10:35 am
- Github: MiiNiPaa
- Discord: MiiNiPaa#4384
- Contact:
Re: Regards image path with renpy.show() function
https://www.renpy.org/doc/html/trans_tr ... #Transformbonnie_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).
< < insert Rick Cook quote here > >
Who is online
Users browsing this forum: bonnie_641, Google [Bot]