You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
okay, i have confirmed lightworld rotates (sort of), if i put in the love.graphics.rotate into the actual lightworld function bit, in my code, in ee_engine.lua:
lightWorld:draw(function() --this is the lightworld pass
love.graphics.rotate(camera.rotation)
for _,entity in pairs(self.entities) do
entity:lightdraw()
end
end)
i found if i omit, the scaling and translation, it is the closest to working correctly.
i found also, the sequence is important, so lightworld has received the scaling and translation, it is important other draws follow the same sequence (rotation MUST be last)
this investigation suggests the code on the main page might be wrong?? you are not supposed to scale and translate in love.draw()
Please, have a look at my code, at least try using the controls to see. It has WSAD directions, QE scale, and RF rotate.
You can switch on (in ee_engine.lua) a non-lightpass, with Engine.draw_non_lightpass = true
I have managed to get both passes to exactly match each other.
Sorry i am so long winded, the fundamental issue is, the lights do not rotate with the scene, if you rotate my (attempted) camera, you will find the lights do not rotate (so lightworld sprites rotate fine, it's lights do not).
This little framework, i was hoping to integrate all this stuff, light, physics, camera, and eventually UDP, into one thing bases on the usual sort of Unity style component model. The best bit so far is the physics are optional :)
Summary of code:
main.lua
ee_engine.lua --the singleton
ee_entity.lua --the in game objects
The text was updated successfully, but these errors were encountered:
i still kinda like this product and think i might just decide not to use rotation, but it would be nice to solve this, and i may have highlighted someting strange about setting translations to the lightworld:
lightWorld:update(dt)
lightWorld:setTranslation(x, y, scale)
also my code is free as in free, if any code i made was useful to people i'd be honoured to have helped (but it may not be to people's tastes here as they tend to make these bits themselves)
in love 2d, the official way to make the sequence is:
translate
rotate
scale
to line things up correct, translate needs to occur first i believe (rotate and scale could be interchanged in sequence)... this is handy, as lightdraw will only rotate it appears if you chuck the rotate inside it?
something is not right with this, perhaps it's a shame that lightworld could not be a fundamental part of love 2d itself, i feel this would be the best thing, we're trying to line up a now very complicated sequence of translations
okay, i have confirmed lightworld rotates (sort of), if i put in the love.graphics.rotate into the actual lightworld function bit, in my code, in ee_engine.lua:
i found if i omit, the scaling and translation, it is the closest to working correctly.
i found also, the sequence is important, so lightworld has received the scaling and translation, it is important other draws follow the same sequence (rotation MUST be last)
this investigation suggests the code on the main page might be wrong?? you are not supposed to scale and translate in love.draw()
Please, have a look at my code, at least try using the controls to see. It has WSAD directions, QE scale, and RF rotate.
You can switch on (in ee_engine.lua) a non-lightpass, with Engine.draw_non_lightpass = true
I have managed to get both passes to exactly match each other.
Sorry i am so long winded, the fundamental issue is, the lights do not rotate with the scene, if you rotate my (attempted) camera, you will find the lights do not rotate (so lightworld sprites rotate fine, it's lights do not).
EntityEngine.zip
This little framework, i was hoping to integrate all this stuff, light, physics, camera, and eventually UDP, into one thing bases on the usual sort of Unity style component model. The best bit so far is the physics are optional :)
Summary of code:
main.lua
ee_engine.lua --the singleton
ee_entity.lua --the in game objects
The text was updated successfully, but these errors were encountered: