Page 1 of 1

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

Posted: Sun Aug 01, 2021 12:59 pm
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

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

Posted: Sun Aug 01, 2021 2:06 pm
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

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

Posted: Mon Aug 02, 2021 6:04 am
by andriodmactemporary
Thanks, it worked, is there a way to specify image resolution with renpy.show().

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

Posted: Mon Aug 02, 2021 7:49 pm
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

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

Posted: Mon Aug 02, 2021 8:24 pm
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.

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

Posted: Tue Aug 03, 2021 5:54 am
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.

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

Posted: Tue Aug 03, 2021 5:54 am
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.

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

Posted: Tue Aug 03, 2021 1:52 pm
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

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

Posted: Tue Aug 03, 2021 3:15 pm
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