How to make terminal in love2d

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help, read this.
Post Reply
Mangro
Prole
Posts: 2
Joined: Sat Aug 27, 2022 12:44 pm

How to make terminal in love2d

Post 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!
Rigachupe
Party member
Posts: 100
Joined: Fri Jun 18, 2021 11:21 am

Re: How to make terminal in love2d

Post 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
User avatar
knorke
Party member
Posts: 274
Joined: Wed Jul 14, 2010 7:06 pm
Contact:

Re: How to make terminal in love2d

Post 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
Mangro
Prole
Posts: 2
Joined: Sat Aug 27, 2022 12:44 pm

Re: How to make terminal in love2d

Post 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!
Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot], Google [Bot] and 4 guests