Make the screen have a constant sway/floating movement?
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.
- Rainvillain
- Regular
- Posts: 76
- Joined: Thu Mar 05, 2015 11:27 am
- Contact:
Make the screen have a constant sway/floating movement?
Hello!
Working on a game that takes place aboard a ship and I was wondering if there was a way of having a subtle little swaying to the camera up and down to give the impression of being on water.
I know how to do basic stuff like panning the screen to the left/right/up/down but it's always been one-off things, that happen inbetween dialogue and not concurrently (or looping).
Not sure how to have a loopable "transform" animation that runs on the screen and characters in the background while the scene unfolds.
Any advice?
Working on a game that takes place aboard a ship and I was wondering if there was a way of having a subtle little swaying to the camera up and down to give the impression of being on water.
I know how to do basic stuff like panning the screen to the left/right/up/down but it's always been one-off things, that happen inbetween dialogue and not concurrently (or looping).
Not sure how to have a loopable "transform" animation that runs on the screen and characters in the background while the scene unfolds.
Any advice?
- Alera
- Miko-Class Veteran
- Posts: 651
- Joined: Sun Mar 21, 2010 3:20 am
- Completed: Tortichki // Zayay // Hero's Spirit
- Deviantart: psyalera
- itch: psyalera
- Location: UK
- Contact:
Re: Make the screen have a constant sway/floating movement?
Hello!
I'm not sure how to apply it to the whole screen per se but you could easily apply such effect to individual elements (or all of them if you wish) using ATL
So it would be something like this:
I hope this helps?
I'm not sure how to apply it to the whole screen per se but you could easily apply such effect to individual elements (or all of them if you wish) using ATL
So it would be something like this:
Code: Select all
init-2:
transform ship_sway:
ypos -10 #You'll have to play around with these values and see what works for the images you've got and the effect you want.
linear 0.5 ypos -15
linear 0.5 ypos -10
repeat #This is what makes it loop
label start:
show ship_bg at ship_sway
- PyTom
- Ren'Py Creator
- Posts: 16093
- 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: Make the screen have a constant sway/floating movement?
You can apply it to the entire master layer with:
Code: Select all
show layer master at ship_sway
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?)
Software > Drama • https://www.patreon.com/renpytom
- Rainvillain
- Regular
- Posts: 76
- Joined: Thu Mar 05, 2015 11:27 am
- Contact:
Re: Make the screen have a constant sway/floating movement?
Great, thank you both for the replies!!
- Rainvillain
- Regular
- Posts: 76
- Joined: Thu Mar 05, 2015 11:27 am
- Contact:
Re: Make the screen have a constant sway/floating movement?
Follow up question: the "show layer master at ship_sway" works perfectly, but what if I wanted just one layer that didn't sway?
In my case, I want the ship (and characters) in the foreground to sway but not the sky and clouds, which are on their own layer behind everything else. Is there a way to basically apply sway to everything except for one layer?
In my case, I want the ship (and characters) in the foreground to sway but not the sky and clouds, which are on their own layer behind everything else. Is there a way to basically apply sway to everything except for one layer?
-
- Regular
- Posts: 130
- Joined: Sun Jul 26, 2009 7:07 pm
- Location: Fredericton, NB, Canada
- Contact:
Re: Make the screen have a constant sway/floating movement?
You can add extra layers to your Ren'Py game by changing what's in config.layers.
Code: Select all
# Add a "backdrop" layer behind the master layer
init python:
config.layers = [ 'backdrop', 'master', 'transient', 'screens', 'overlay' ]
# Later in your script..
show layer master at ship_sway
show cloudy_sky onlayer backdrop
Flash To Ren'Py Exporter
See the Cookbook thread
See the Cookbook thread
- Rainvillain
- Regular
- Posts: 76
- Joined: Thu Mar 05, 2015 11:27 am
- Contact:
Re: Make the screen have a constant sway/floating movement?
Ah, thank you Kinsman! That makes a lot of sense.
- Letitia_L
- Regular
- Posts: 84
- Joined: Wed Apr 20, 2016 4:33 am
- Projects: Up until the end
- IRC Nick: Letitia
- Tumblr: letigame
- Deviantart: LetitiaLambrechts
- itch: https://letigame.itc
- Contact:
Re: Make the screen have a constant sway/floating movement?
I know this tread is a little old, but I wanted to thank Alera for her answer!
I used this to make a running effectCode: Select all
init-2: transform ship_sway: ypos -10 #You'll have to play around with these values and see what works for the images you've got and the effect you want. linear 0.5 ypos -15 linear 0.5 ypos -10 repeat #This is what makes it loop label start: show ship_bg at ship_sway
Who is online
Users browsing this forum: No registered users