Page 1 of 1

How to make terminal in love2d

Posted: Sat Aug 27, 2022 12:55 pm
by Mangro
I want to make a terminal similar to Liko-12 or other fantasy consoles.
please tell me how to do pixel terminal emulator


Or at least tell me how to make a matrix of characters, thanks!

Re: How to make terminal in love2d

Posted: Sat Aug 27, 2022 5:36 pm
by Rigachupe
Already trying this for a roguelike so i give an advice...

If i print a buffer of characters 30x20 character with love.graphics.rectangle for filling the background color and love.graphics.print for printing the character with foreground color i see a drop down of FPS from 60 to 20. Must be because of the ttf font used i quessed and abandoned this solution.

Then i made a small tile of 16x16 pixels for background as empty white picture and foreground for a character that will be drawn over the background tile. The result again drops down to around 20 FPS.. what the heck right?

So i split the drawing and first i draw the 30x20 tiles for background. Then 30x20 tiles for foreground. FPS stays at 60 with vsync on. Without vsync it goes to around 265.

EDIT: Ok, got it fixed even for ttf font. I did the split of drawing the background first 30x20 and then the 30x20 foreground characters and it stays at 60 FPS vsync or 300 FPS without vsync.

If you need only a console solution look here : https://github.com/tvbronswijk/love-console

Re: How to make terminal in love2d

Posted: Sun Aug 28, 2022 5:53 pm
by knorke
You can load a custom font to use with love.graphics.font
See wiki: https://love2d.org/wiki/love.graphics.newFont (example at bottom of page)
There are tons of free fonts on the internet, random example: https://www.dafont.com/8-bit-pusab.font

Re: How to make terminal in love2d

Posted: Thu Sep 01, 2022 1:38 pm
by Mangro
Rigachupe wrote: Sat Aug 27, 2022 5:36 pm If you need only a console solution look here : https://github.com/tvbronswijk/love-console
Very thanks!