Search found 106 matches

by Whatthefuck
Fri Jul 25, 2014 6:48 pm
Forum: Support and Development
Topic: Preventing lighting from being drawn on the background
Replies: 19
Views: 4872

Re: Preventing lighting from being drawn on the background

Guys, I love you, no homo. You helped me achieve exactly what I needed.

You fucking rock.
by Whatthefuck
Fri Jul 25, 2014 4:38 pm
Forum: Support and Development
Topic: Preventing lighting from being drawn on the background
Replies: 19
Views: 4872

Re: Preventing lighting from being drawn on the background

Using a plain vanilla stencil will only work in restricted cases. If the foreground is made of image with "holes" in it (=transparency) then a stencil will not work. A stencil function always considers the full rectangle of an image. A solution is given on the wiki-page on stencils (see post above)...
by Whatthefuck
Fri Jul 25, 2014 9:51 am
Forum: Support and Development
Topic: Preventing lighting from being drawn on the background
Replies: 19
Views: 4872

Re: Preventing lighting from being drawn on the background

draw_background() love.graphics.setStencil(draw_foreground()) draw_foreground() love.graphics.setStencil() [wiki]love.graphics.setStencil[/wiki] setStencil says you ONLY draw to where the stencil draws. (the stencil is just a function with stuff that is drawn) I can't draw the background manually, ...
by Whatthefuck
Fri Jul 25, 2014 8:34 am
Forum: Support and Development
Topic: Preventing lighting from being drawn on the background
Replies: 19
Views: 4872

Re: Preventing lighting from being drawn on the background

kikito wrote:Show us the code. Give us a .love file showing the issue. Otherwise it's too difficult to help you.
There's so much code and stuff that I'd have to spend hours to pack everything into a separate .love file.

Edit: argh, no automerge. ;_;
by Whatthefuck
Fri Jul 25, 2014 8:33 am
Forum: Support and Development
Topic: Preventing lighting from being drawn on the background
Replies: 19
Views: 4872

Re: Preventing lighting from being drawn on the background

What method are you using for drawing the lighting? Is it a shader or a mesh or something else? It's a spritebatch. A spriteBatch like 1 sprite per pixel? *cough* inefficient *cough* I was guessing for a shader and you did not really explain how you did the lightning. 1. Draw the background 2. Star...
by Whatthefuck
Fri Jul 25, 2014 6:42 am
Forum: Support and Development
Topic: Preventing lighting from being drawn on the background
Replies: 19
Views: 4872

Re: Preventing lighting from being drawn on the background

micha wrote:What method are you using for drawing the lighting? Is it a shader or a mesh or something else?
It's a spritebatch.
by Whatthefuck
Fri Jul 25, 2014 6:06 am
Forum: Support and Development
Topic: Preventing lighting from being drawn on the background
Replies: 19
Views: 4872

Re: Preventing lighting from being drawn on the background

Zer0 wrote:Probably using a canvas for the foreground (everything BUT the background) that is shaded and drawing it ontop of the unshaded background.
[wiki]Canvas[/wiki]
That won't do anything.
by Whatthefuck
Thu Jul 24, 2014 8:06 pm
Forum: Support and Development
Topic: Preventing lighting from being drawn on the background
Replies: 19
Views: 4872

Preventing lighting from being drawn on the background

So I have lighting in my game, however I came across an issue - the shadows are drawn on the background. I need a way of preventing the shadows from being drawn on the background. Here's the problem I came across: http://i.imgur.com/MvzBhmz.png The orange'ish color is the background, and obviously, ...
by Whatthefuck
Tue Jul 22, 2014 11:35 am
Forum: Support and Development
Topic: "Questions that don't deserve their own thread" thread
Replies: 905
Views: 186190

Re: "Questions that don't deserve their own thread" thread

How would I go about serialising C data? I am currently using the FFI library to create a structure that I store lots of data in, and being able to save it is crucial.
by Whatthefuck
Fri Jul 18, 2014 3:01 pm
Forum: Support and Development
Topic: "Questions that don't deserve their own thread" thread
Replies: 905
Views: 186190

Re: "Questions that don't deserve their own thread" thread

What's a screenshot or game example that demonstrates the look you want to achieve with the lighting? We might be able to help with it (and it might be a good idea to make a dedicated thread for it at this point.) Here's what the lighting looks like at the moment: https://www.dropbox.com/s/g5n70g82...