Hello,
I've made a game with love engine(https://github.com/gsaga/Piano-Tiles). It has a debug region which is rendered besides the main game region and it displays logged messages and other debugging data. This region is rendered in love.draw.
See (https://github.com/gsaga/Piano-Tiles/bl ... in.lua#L43) and (https://github.com/gsaga/Piano-Tiles/bl ... er.lua#L41)
But the framerate drops horribly if the number of log lines goes above 15 or so lines. I'm sure it's because of the text because the game runs smooth as butter if the logging is effectively disabled by setting the number of log lines to be displayed to 0(https://github.com/gsaga/Piano-Tiles/bl ... ger.lua#L8).
The contents of the screen are reset between subsequent calls to love.draw, hence every iteration needs to paint the whole screen. Is there a way I can tell the engine to not do that(at least for some regions of the window)?
This would have many other use cases as well, like drawing some effects over the game area when the player wins(or looses) and blurring the background when a dialog is displayed.
Framerate drops when rendering more that 20 lines of text.
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
Re: Framerate drops when rendering more that 20 lines of text.
Try creating the lines to display as Text objects. See love.graphics.newText.
There's no way around starting drawing the screen from scratch each frame, but if you want to have a somewhat static part in the screen, or apply effects, you can use a canvas. The canvas will preserve its contents between frames, and you can draw it to the screen each frame.
There's no way around starting drawing the screen from scratch each frame, but if you want to have a somewhat static part in the screen, or apply effects, you can use a canvas. The canvas will preserve its contents between frames, and you can draw it to the screen each frame.
Re: Framerate drops when rendering more that 20 lines of text.
That worked, thanks.pgimeno wrote: ↑Fri Jul 06, 2018 6:46 pm Try creating the lines to display as Text objects. See love.graphics.newText.
Who is online
Users browsing this forum: Google [Bot] and 1 guest