Flashlight Effect For Ren'Py Games
Added 2024-07-30 10:32:08 +0000 UTCThis is a fun little script showcasing how you can make a scene in your game that's interactive with items to click on. But to find the items you need to move around your flashlight to see them. Might be fitting for some spooky games now that Halloween is nearing. 😁
It uses an image that's larger than the project resolution and is filled with a somewhat transparent black color. In the middle is a cutout that allows you to see through it. The image then follows your cursor around to reveal the background and items that can be interacted with.
There's also an additional smaller circular "light" image that's centered in the middle of the cutout for an extra flashlight effect.
Both of these images are inside of transforms that are moved according to the mouse movement using a custom transform function.
To show dialogue above the screen we can first show the screen in a label, and set it to insensitive so we can't interact with it while dialogue is showing. Then we add dialogue and when done, transfer control to the screen, as well as set it to sensitive to allow interaction with it.
As usual the script is commented for explanations, but if you have questions feel free to ask them in the comments of this post.
Comments
Damn, this is so perfect!!! I had no idea that was possible to make in Renpy
Pytem
2024-08-01 14:01:21 +0000 UTC