Posted May 24, 2025 by Bastian
Today i made some smart roguelike console. For speed improvements i mention some tricks. Listen carefully.
1.do not use ttf fonts, they look cool but are slow to render even on a good machine -> fix this by using a bitmap font from a png file
2.do not draw rectangles under each character by love.graphics.rectangle it is slow -> either render a space character this way or prepare a small sprite with the same size as one char and render that with any color but let the sprite by just white
3.each character in a console is a small table that contains : char, x,y position, foreground color and background color as r,g,b values a is always 1 -> by this trick you never again repeat the calculation of x,y or calculation of index of color for background or foreground
Now you have a nice console maybe 50x25 chars prepared to be drawn very fast.