Having difficulty using image manipulators to scale images.

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
Ortintzki
Newbie
Posts: 4
Joined: Wed Nov 18, 2015 4:32 pm
Contact:

Having difficulty using image manipulators to scale images.

#1 Post by Ortintzki »

Hi there,

I'm trying to create a scaled image and display it inside a frame. However, I don't know how to correctly create the image and display it.

I'm using this line to create the scaled image:

Code: Select all

image new_image = im.Scale("new_image", 700, 500)
However, when I try to use it in this code snippet, I get "show is not a keyword argument or valid child for the frame statement."

Code: Select all

screen grid_test():
    
    grid 2 2:
        frame:
            area (10, 10, 700, 500)
            show new_image
And when I try to do it like this, I get "expected a keyword argument, colon, or end of line.

Code: Select all

screen grid_test():
    
    grid 2 2:
        frame:
            area (10, 10, 700, 500)
            
            text "Top-Left" 
            image new_image = im.Scale("new_image", 700, 500)
Does anyone know what's going on and how to fix it?

User avatar
mobychan
Veteran
Posts: 275
Joined: Fri Apr 24, 2015 6:31 am
Projects: The Chosen - Sakura Pink & Gentian Blue
Organization: Foresoft
Location: Germany
Contact:

Re: Having difficulty using image manipulators to scale imag

#2 Post by mobychan »

use

Code: Select all

add new_image
in screens ;)

Ortintzki
Newbie
Posts: 4
Joined: Wed Nov 18, 2015 4:32 pm
Contact:

Re: Having difficulty using image manipulators to scale imag

#3 Post by Ortintzki »

Thanks for the help. The "add" statement was able to get the image onto the screen. Unfortunately I couldn't figure out how to also use image manipulators with the add statement, but I was able to scale the image with transform statements.

User avatar
mobychan
Veteran
Posts: 275
Joined: Fri Apr 24, 2015 6:31 am
Projects: The Chosen - Sakura Pink & Gentian Blue
Organization: Foresoft
Location: Germany
Contact:

Re: Having difficulty using image manipulators to scale imag

#4 Post by mobychan »

You can list them behind the add command, or add a block underneath (ending the add line with ":")

Post Reply

Who is online

Users browsing this forum: Ocelot