lets assume i have a declared image
image pic1 = "pic1.png"
how do i get its width and height in pixels?
I'm planning to use this to morph im.Scale() displayable so it will scale to the fixed width or height maintaining the aspect ratio. Maybe such displayable already exist and I fail to find it. If i do, please tell me. Many thanks
[solved]How do i get the size of my image (in pixels)?
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.
[solved]How do i get the size of my image (in pixels)?
Last edited by SONTSE on Thu Oct 02, 2014 5:11 pm, edited 1 time in total.
Look! It's moving. It's alive. It's alive... IT'S ALIVE! Oh, in the name of God! Now I know what it feels like to be God!(@Henry_Frankenstein. Sums up my coding style)
- PyTom
- Ren'Py Creator
- Posts: 15893
- 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: How do i get the size of my image (in pixels)?
If you really want to, you can use renpy.image_size.
It's a bad idea, since it requires loading the images at init time. It's far better to bite the bullet and code in image sizes.
It's a bad idea, since it requires loading the images at init time. It's far better to bite the bullet and code in image sizes.
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?)
"Silly and fun things are important." - Elon Musk
Software > Drama • https://www.patreon.com/renpytom
Re: How do i get the size of my image (in pixels)?
Okay, I noted it, so, if performance or stability will cry this thing will be one suspected. I'll stick with it for now since "biting a bullet" method is also a quite an issue ^^
Well. Anyway - always thankful for you, PyTom! You do a great job =)
Well. Anyway - always thankful for you, PyTom! You do a great job =)
Look! It's moving. It's alive. It's alive... IT'S ALIVE! Oh, in the name of God! Now I know what it feels like to be God!(@Henry_Frankenstein. Sums up my coding style)
Who is online
Users browsing this forum: Google [Bot]