How would I go about making a flashlight effect in Love2D?

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help, read this.
Post Reply
MaxGamz
Party member
Posts: 104
Joined: Fri Oct 28, 2022 3:09 am

How would I go about making a flashlight effect in Love2D?

Post by MaxGamz »

I searched for forum posts relating to the subject and I found a user example of this however the love file doesn't seem to be working. I heard that it involves the use of shaders however I want to keep my project as simple as possible.
User avatar
darkfrei
Party member
Posts: 1197
Joined: Sat Feb 08, 2020 11:09 pm

Re: How would I go about making a flashlight effect in Love2D?

Post by darkfrei »

MaxGamz wrote: Sun Aug 13, 2023 7:14 pm I searched for forum posts relating to the subject and I found a user example of this however the love file doesn't seem to be working. I heard that it involves the use of shaders however I want to keep my project as simple as possible.
Like this? viewtopic.php?p=244842#p244842
:awesome: in Lua we Löve
:awesome: Platformer Guide
:awesome: freebies
Xugro
Party member
Posts: 114
Joined: Wed Sep 29, 2010 8:14 pm

Re: How would I go about making a flashlight effect in Love2D?

Post by Xugro »

I attached a simple example that works without shaders.

Thanks to SD.Chatane for the image (licensed under Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)).
Attachments
flashlight_example.love
(510.3 KiB) Downloaded 74 times
MaxGamz
Party member
Posts: 104
Joined: Fri Oct 28, 2022 3:09 am

Re: How would I go about making a flashlight effect in Love2D?

Post by MaxGamz »

darkfrei wrote: Sun Aug 13, 2023 7:43 pm
MaxGamz wrote: Sun Aug 13, 2023 7:14 pm I searched for forum posts relating to the subject and I found a user example of this however the love file doesn't seem to be working. I heard that it involves the use of shaders however I want to keep my project as simple as possible.
Like this? viewtopic.php?p=244842#p244842
Somewhat but not really, I mean like a triangular ray that spreads out that illuminates the scenery
MaxGamz
Party member
Posts: 104
Joined: Fri Oct 28, 2022 3:09 am

Re: How would I go about making a flashlight effect in Love2D?

Post by MaxGamz »

Xugro wrote: Sun Aug 13, 2023 8:20 pm I attached a simple example that works without shaders.

Thanks to SD.Chatane for the image (licensed under Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)).
Oh yeah that's very useful! it's basically what I am looking for
User avatar
knorke
Party member
Posts: 274
Joined: Wed Jul 14, 2010 7:06 pm
Contact:

Re: How would I go about making a flashlight effect in Love2D?

Post by knorke »

This looks the same as Xugro's light but using stencils:

Attachments
stencil_light.love
(1.03 KiB) Downloaded 70 times
Post Reply

Who is online

Users browsing this forum: Azzla, Google [Bot] and 1 guest