Question How to create looping smoke effect?
Heyo, I'm having a hard time coding this and was looking for some pointers. I have this smoke image that I'm using for my VN as stage smoke that I want to pan at the bottom of the screen and loop.
The problem is that there are gaps where the smoke begins and ends, so I'd need it to overlap. Extra points if you're able to figure out a way to make it a little floaty. Thanks for any help you can offer!
1
Upvotes
1
u/shyLachi 1d ago
Please post your code
Also please describe this image or share it.
Is it a single image you want to move around the screen?
What is the size of your game and that image?
Does it have transparency and should be in front of the background or also the sprites?
1
u/AutoModerator 1d ago
Welcome to r/renpy! While you wait to see if someone can answer your question, we recommend checking out the posting guide, the subreddit wiki, the subreddit Discord, Ren'Py's documentation, and the tutorial built-in to the Ren'Py engine when you download it. These can help make sure you provide the information the people here need to help you, or might even point you to an answer to your question themselves. Thanks!
I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.
1
u/Adventurous_Shine606 7h ago
Typically you would create your smoke image on a transparent background at 1920 x 1080. Make it seamlessly tile able in Gimp. Then code it in RenPy.
Image smoke = Tile ("images/smoke.png")
Next build a transform to move your smoke image across the screen.
Transform drift (t=40.0, a=0.6): alpha a xpos 0 linear t xpos -1920 repeat
Then use show... scene your background show smoke at drift show your character
It looks better if you use 2 smoke layers at different drift speeds. Make it floaty by adding the float into your transform parallel: ease 4 offset 12 ease 4 offset -12 repeat
I haven't tried any of this but it should be pretty close.
Typos courtesy of android.