Using Love's engine in different way
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
Using Love's engine in different way
I've grown extremely appreciative of the graphics library that Love has. I was wondering if it were possible to use the engine with just the graphics library (and then just be able to call a graphics update when I need it without overcomplicated program flow). I feel rather limited by how it's structured (with the three different sectioned functions) and would rather be able to structure it in my own way.
Re: Using Love's engine in different way
Take a look at https://love2d.org/wiki/love.run , love.graphics.clear and love.graphics.present.Garan wrote:I've grown extremely appreciative of the graphics library that Love has. I was wondering if it were possible to use the engine with just the graphics library (and then just be able to call a graphics update when I need it without overcomplicated program flow). I feel rather limited by how it's structured (with the three different sectioned functions) and would rather be able to structure it in my own way.
Use https://love2d.org/wiki/conf.lua to disable other modules.
Re: Using Love's engine in different way
You can define your own love.run to easily achieve this. I'm not sure why you'd want to do that though, especially if you're using Löve for game development. The way it works right now is quite semantic and logical.
Could you share with us your ideal way that it should be handled? (e.g. your own love.run function)
Could you share with us your ideal way that it should be handled? (e.g. your own love.run function)
Do you recognise when the world won't stop for you? Or when the days don't care what you've got to do? When the weight's too tough to lift up, what do you? Don't let them choose for you, that's on you.
Re: Using Love's engine in different way
I am trying to make something turn-based. I figured that it would be much easier if I could control when I refresh the screen (this would also make things like menus easier to display). Also, can I alter love.draw to be able to be overloaded (or at least be called with another parameter)?
Re: Using Love's engine in different way
Keep in mind that you are at the mercy of the OS window manager if you don't redraw frequently. It's not a problem if the window stays on top of everything, but if another window temporarily obscures it, the window manager may assume that you're going to redraw the part that was covered. If you don't, it may contain garbage. Some operating systems push an event for this, but that's not exposed in LÖVE (or SDL). The behaviour is also different for every OS.
You can handle it properly by using a Canvas as your screen. You only have to clear and redraw the Canvas if there was a change, but can draw it to the screen continuously so the window stays updated.
There's no such thing as overloading in Lua (all functions are anonymous) but yes, if you use your own modified love.run, you can pass to love.draw whatever you want.
You can handle it properly by using a Canvas as your screen. You only have to clear and redraw the Canvas if there was a change, but can draw it to the screen continuously so the window stays updated.
There's no such thing as overloading in Lua (all functions are anonymous) but yes, if you use your own modified love.run, you can pass to love.draw whatever you want.
Shallow indentations.
Who is online
Users browsing this forum: No registered users and 9 guests