Change a specific image's size when displayed?

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
renpyhelp
Regular
Posts: 71
Joined: Tue Feb 27, 2018 2:01 am
Contact:

Change a specific image's size when displayed?

#1 Post by renpyhelp »

Hi,
I'm trying to figure out if it's possible to change an image's size within ren'py. Say it's a 1280x720 image but I want it to fit at a specific part of the screen that is overall smaller than the resolution. Is that possible, and if so, how? I would like to move the image to specific X/Y coordinates as well.
Also, is it possible when showing a looping video, when using the show command?
Thanks!

DragoonHP
Miko-Class Veteran
Posts: 758
Joined: Tue Jun 22, 2010 12:54 am
Completed: Christmas
IRC Nick: DragoonHP
Location: Zion Island, Solario
Contact:

Re: Change a specific image's size when displayed?

#2 Post by DragoonHP »

Yes it is. Something like this should work:

Code: Select all

transform set_size():
    size(100, 150)
    xpos 10
    ypos 10
Then show your image with something like this show image_name at set_size
Read more about ATL Properties to see what else you can do with images https://www.renpy.org/doc/html/atl.html ... properties

And as far as I know, you should be able to apply size, xpos, ypos property to movies too.

renpyhelp
Regular
Posts: 71
Joined: Tue Feb 27, 2018 2:01 am
Contact:

Re: Change a specific image's size when displayed?

#3 Post by renpyhelp »

Thank you very much. I haven’t really used transform before and I’ll give this a try as soon as I can. Thanks!

User avatar
Imperf3kt
Lemma-Class Veteran
Posts: 3791
Joined: Mon Dec 14, 2015 5:05 am
itch: Imperf3kt
Location: Your monitor
Contact:

Re: Change a specific image's size when displayed?

#4 Post by Imperf3kt »

You could also define an image using im.FactorScale("image", number)
Where number is the amount to scale by.
For example, 0.5 would be half size, 1.0 would be full size, 2.0 double, etc.
Warning: May contain trace amounts of gratuitous plot.
pro·gram·mer (noun) An organism capable of converting caffeine into code.

Current project: GGD Mentor

Twitter

Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot], henne