Search found 4 matches

by vityafx
Mon Jun 01, 2020 1:38 pm
Forum: Support and Development
Topic: Performance: should changing from if conditions to calling different functions be preferred?
Replies: 2
Views: 5223

Performance: should changing from if conditions to calling different functions be preferred?

Suppose I have a code in the `draw`: function Running:draw() if self.paused then self:draw_pause() self:draw_hud() return end self:draw_game() end In the keypress handler which then sets self:paused to true, there are two different ways one could do: 1. Add this if statement into the draw() call and...
by vityafx
Mon Nov 13, 2017 2:24 pm
Forum: Support and Development
Topic: Callback on window position change
Replies: 7
Views: 5094

Re: Callback on window position change

Yes, I know I can do things via SDL2 but I asked about an API in the love2d :) It would be much better to have such a functionality right inside the love2d as we have `keypressed` and other callbacks there. There is a real need in this - people have now multiple monitors setup and if their monitors...
by vityafx
Mon Nov 13, 2017 7:04 am
Forum: Support and Development
Topic: Callback on window position change
Replies: 7
Views: 5094

Re: Callback on window position change

Hi and welcome to the forums! There's actually a way; SDL2 has a function to get the "global" position of the window's top-left corner; you could in theory create a neat layout of your active monitors/screens with that, but you'll need to use the FFI to access that function. I do have cod...
by vityafx
Sat Nov 11, 2017 6:02 pm
Forum: Support and Development
Topic: Callback on window position change
Replies: 7
Views: 5094

Callback on window position change

I could not find any information about having such an information. I need this for two things: 1. If a window changes the monitor (the game window moved to another monitor) than I should recalculate the fps and so on based on the monitor's refresh rate. 2. If a window has changed it's position then ...