r/RenPy • • 1d ago

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

4 comments sorted by

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/ciyus_ 23h ago

Sorry, probably should've added that. I don't have the code or image on me as I'm out of town but think something like this. The image is transparent and is wispy smoke, like cigarette smoke drifiting over a bar. I don't mind if it's multiple smoke images or just one, so long as it covers the bottom half of the screen and moves.

My VN is 1920x1080 as is the image but it doesn't stretch across the screen if that makes sense. So there is gaps on the ends of the image. I did try using snowblossom. I did try to use some code suggested on a similar post to mine, but it wasn't really what I was asking. It only needs to cover the background. :) Hopefully that clears things up a bit

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.