Custom Transform?

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
lindsay-jb
Regular
Posts: 68
Joined: Tue Aug 25, 2020 1:05 am
Contact:

Custom Transform?

#1 Post 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!

User avatar
Ocelot
Lemma-Class Veteran
Posts: 2384
Joined: Tue Aug 23, 2016 10:35 am
Github: MiiNiPaa
Discord: MiiNiPaa#4384
Contact:

Re: Custom Transform?

#2 Post 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)
< < insert Rick Cook quote here > >

lindsay-jb
Regular
Posts: 68
Joined: Tue Aug 25, 2020 1:05 am
Contact:

Re: Custom Transform?

#3 Post 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!

Post Reply

Who is online

Users browsing this forum: No registered users