Closed evanpaul closed 4 years ago
How are you drawing everything to the screen? (your love.draw function)
function love.draw()
camera:draw(function(l,t,w,h)
map:draw()
draw_objects()
draw_ui()
light_world:Draw()
-- putting draw_ui() here makes the UI invisible
end)
end
I am using gamera for camera rendering, which could be affecting things? Unsure.
@evanpaul22 for UI, you could put that outside of the camera draw.
something like:
camera:draw(function(l,t,w,h)
map:draw()
draw_objects()
light_world:Draw()
end)
love.graphics.setCanvas(ui_canvas)
draw_ui()
love.graphics.setCanvas()
love.graphics.draw(ui_canvas)
Could also possibly be the blend modes or translation, the light world uses it's own translation which gets changed every time it draws it's canvas. You could try setting those properties right before drawing the user interface.
Check out what I'm using on this method https://github.com/matiasah/shadows/blob/cc84387fb15cc7451f7d736a88c08f68b6372435/LightWorld.lua#L146
Please tell me what your results are.
@flamendless That worked! @matiasah I think you're right. Another solution that worked here was putting a call to love.graphics.reset() after the LightWorld:Draw() and before drawing UI.
Thanks to both of you for the support!
I'm still learning this library, so apologies if this is obvious. I am rendering a number of lights/stars, but I want to have a UI layer that is not affected by lighting. What's the easiest way to do this? I've tried playing around with canvases but I can't seem to get it to work