How do you resize an image?

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
User avatar
Smoothie-Kisses
Newbie
Posts: 6
Joined: Sun Feb 03, 2013 11:16 am
Contact:

How do you resize an image?

#1 Post by Smoothie-Kisses » Sun Feb 03, 2013 12:47 pm

For my visual novel there is a scene where a character is visible but the character is too big to see the whole character (right now i can only see his waist) and i am wondering is there anything to help shrink the character?
:?



-Thank you!

User avatar
Ayutac
Regular
Posts: 150
Joined: Thu Oct 18, 2012 2:23 pm
Projects: Pokémon Dating Sim
Organization: A Breeze Of Science
Deviantart: Ubro
Location: Mayence, Germany
Contact:

Re: How do you resize an image?

#2 Post by Ayutac » Sun Feb 03, 2013 1:33 pm

Wild guess: Google + "renpy scale"
Result: this

Feel free to adapt this concept for further questions that may arise.
Up next: An original, open source, text-based Dating Sim. Stay tuned ;)

User avatar
Donmai
Eileen-Class Veteran
Posts: 1919
Joined: Sun Jun 10, 2012 1:45 am
Completed: Toire No Hanako, Li'l Red [NaNoRenO 2013], The One in LOVE [NaNoRenO 2014], Running Blade [NaNoRenO 2016], The Other Question, To The Girl With Sunflowers
Projects: Slumberland
Location: Brazil
Contact:

Re: How do you resize an image?

#3 Post by Donmai » Sun Feb 03, 2013 9:11 pm

You may find it very complicated, maybe it really is, but here I go:

I have a very big sprite (806x2244) and I use transforms to show it in my game screen (my game is 1024x640). Put the following code inside your Init block (the start of your game code, where you define your sprites, backgrounds and so on):

Code: Select all

transform natural_size:
             on show:
             yalign 610 xalign 0.5

Code: Select all

transform half_size:
        size (400,1114) crop(0,0,806,2244)
        on show:
            yalign 610 xalign 0.5
You can change the example names "natural_size" and "half_size", if you want. Change 806,2244 to the width and height of your sprite in pixels.

yalign is the number of lines of pixels of the image that will be shown from top to bottom. You can change it for your image. In my case, my 806x2244 sprite is shown from the tip of the head down to the shoulders.

In the second transform, size is the new size of the image that you want (must be proportional to the original size, or the image may be deformed). Using this transform, my sprite is shown from the tip of the head down to his knees.

How to use this in your game? You will simply write:

Code: Select all

show mySprite at natural_size
or

Code: Select all

show mySprite at halfsize, left
write the name of your sprite in place of "mySprite".
Image
No, sorry! You must be mistaking me for someone else.
TOIRE NO HANAKO (A Story About Fear)

User avatar
Smoothie-Kisses
Newbie
Posts: 6
Joined: Sun Feb 03, 2013 11:16 am
Contact:

Re: How do you resize an image?

#4 Post by Smoothie-Kisses » Mon Feb 04, 2013 12:23 pm

Thanks for your help, i'll try it :)


xxxx

Post Reply

Who is online

Users browsing this forum: Bing [Bot], khezo, span4ev, _ticlock_