Page 1 of 1

Custom Transform?

Posted: Wed May 05, 2021 12:43 am
by lindsay-jb
I have a transform statement that, when used, zooms the image in originating from a specified point. However, in renpy, "left" refers to the bottom left, and I want my image to originate from the middle left. Here's my code:

Code: Select all

transform inleft():
    offscreenleft
    zoom 0.1
    ease 0.3 zoom 1.0 align (0.0, 1.0)
Is there a way I can customize a position or something, so that the image will originate from the middle left of the screen and not bottom left? Thanks!

Re: Custom Transform?

Posted: Wed May 05, 2021 2:08 am
by Ocelot
lindsay-jb wrote: Wed May 05, 2021 12:43 am Is there a way I can customize a position or something
Yes. There is (x/y)align, (x/y)anchor and (x/y)pos. You probably want something like:

Code: Select all

anchor (1.0, 0.5)
pos (0.0, 0.5)

Re: Custom Transform?

Posted: Wed May 05, 2021 11:03 pm
by lindsay-jb
That's great, it worked perfectly!

Is there a way to do that for moving the image offscreen? I have animation to zoom the character in from the side and out from the side, but I would like the zoom out to be halfway up the screen, like the zoom in now is. I've been messing around using anchor/pos/align, but haven't come up with anything. Right now, this is the code I have, and the image zooms out to the bottom left corner:

Code: Select all

transform outleft():
    zoom 1.0
    ease 0.3 offscreenleft zoom 0.1
Thank you!