Making an image fit the screen

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
Robosparks
Newbie
Posts: 6
Joined: Wed Jun 18, 2014 2:19 pm
Projects: The Woods
Location: England, UK
Contact:

Making an image fit the screen

#1 Post by Robosparks » Wed Jun 18, 2014 3:53 pm

Hi everyone! I'm super new here, so the answer to this is most likely obvious, but...

I'm having problems with getting (Large) images to be a bit less zoomed in. It'd probably work if I used an image editor to shrink the image but is there a way to scale it in Ren'Py itself?

If anyone can post any Ren'Py methods of adjusting the size of images, I'd appreciate it.

Thanks for reading!

User avatar
Asceai
Eileen-Class Veteran
Posts: 1258
Joined: Fri Sep 21, 2007 7:13 am
Projects: a battle engine
Contact:

Re: Making an image fit the screen

#2 Post by Asceai » Wed Jun 18, 2014 3:57 pm

You can use a zoom transform in atl that applies when you show it, like:

Code: Select all

show picture:
  zoom 0.8
Or associate the atl with the image declaration so it can be reused without supplying atl whenever you show it:

Code: Select all

image picture:
  "picture.png"
  zoom 0.8
Or you can modify the image as it is loaded with im.FactorScale:

Code: Select all

image picture = im.FactorScale("picture.png", 0.8)
This is probably a better approach as it won't interfere with you using ATL zoom to modify the image when shown dynamically later, for special effects etc.

Robosparks
Newbie
Posts: 6
Joined: Wed Jun 18, 2014 2:19 pm
Projects: The Woods
Location: England, UK
Contact:

Re: Making an image fit the screen

#3 Post by Robosparks » Wed Jun 18, 2014 4:12 pm

Ok, I'll try those two methods out and see what works best.

Thank you!

Post Reply

Who is online

Users browsing this forum: enaielei, Google [Bot]