Text Editor

Showcase your libraries, tools and other projects that help your fellow love users.
User avatar
retrotails
Party member
Posts: 212
Joined: Wed Apr 18, 2012 12:37 am

Text Editor

Post by retrotails »

Basic text editor, has some issues.
Issues:
- When a single word is longer then the text limit, its cut permanently. I won't fix this, but word wrap will be optional.
- Slow, renders every character every frame. I'll later have a custom love.draw or canvas that only updates when needed.
- Spaces are ~1 pixel shorter then all other (mono space) characters. Don't know how to fix this.
- You can delete the text so it has a negative total length. I'll fix this soon, I just didn't realize it was there for a while.
https://www.youtube.com/watch?v=0zgDVAD8yl0

v1.0
First release

v1.1
Added canvas option for better performance
Fixed backspace edge case
Last edited by retrotails on Thu Mar 14, 2013 4:20 pm, edited 1 time in total.
User avatar
Djent
Prole
Posts: 27
Joined: Sun Jan 20, 2013 3:22 pm
Location: Rhode Island

Re: Text Editor

Post by Djent »

retrotails wrote: - Slow, renders every character every frame. I'll later have a custom love.draw or canvas that only updates when needed.
I believe you can edit love.run and just comment out "love.graphics.clear()" that it does every frame, but you'll have to manually clear what you want.
User avatar
bartbes
Sex machine
Posts: 4946
Joined: Fri Aug 29, 2008 10:35 am
Location: The Netherlands
Contact:

Re: Text Editor

Post by bartbes »

Djent wrote: I believe you can edit love.run and just comment out "love.graphics.clear()" that it does every frame, but you'll have to manually clear what you want.
That is most likely to go wrong, you know single/double/triple buffering, no redraws when another application was on top of this one, that kind of stuff.
User avatar
iPoisonxL
Party member
Posts: 227
Joined: Wed Feb 06, 2013 3:53 am
Location: Australia
Contact:

Re: Text Editor

Post by iPoisonxL »

this is really cool, has some potential. When you do backspace though, you start going off to the side. Like, leaving the screen. Really cool other than those small bugs.

Code: Select all

      L
    L Ö
    Ö V
L Ö V E
Ö B E
V E
E Y
Website
User avatar
retrotails
Party member
Posts: 212
Joined: Wed Apr 18, 2012 12:37 am

Re: Text Editor

Post by retrotails »

iPoisonxL wrote:this is really cool, has some potential. When you do backspace though, you start going off to the side. Like, leaving the screen. Really cool other than those small bugs.
Fixed now. Thanks by the way, glad to hear somebody sees it has potential. It's going to be a serverless secure chat program, encrypting and decrypting in all Lua.
User avatar
Lafolie
Inner party member
Posts: 809
Joined: Tue Apr 05, 2011 2:59 pm
Location: SR388
Contact:

Re: Text Editor

Post by Lafolie »

You could use a canvas, or group of canvases to help lighten the drawing operations.

Also, how do you plan on implementing encryption? This is something I've thought about before - Lua doesn't seem to be the greatest candidate for running encryption programs.
Do you recognise when the world won't stop for you? Or when the days don't care what you've got to do? When the weight's too tough to lift up, what do you? Don't let them choose for you, that's on you.
User avatar
Robin
The Omniscient
Posts: 6506
Joined: Fri Feb 20, 2009 4:29 pm
Location: The Netherlands
Contact:

Re: Text Editor

Post by Robin »

Lafolie wrote:Lua doesn't seem to be the greatest candidate for running encryption programs.
You mean in terms of encryption/decription speed, right?

That's true, most useful encryption algorithms are either optimised for implementation in hardware or in a certain kind of software (lots of bit shifts and xors and stuff).

On the other hand, that's likely not going to matter that much when you probably will only be sending a few bytes per second on average.
Help us help you: attach a .love.
User avatar
Lafolie
Inner party member
Posts: 809
Joined: Tue Apr 05, 2011 2:59 pm
Location: SR388
Contact:

Re: Text Editor

Post by Lafolie »

I did mean that.

I was considering ways to encrypt passwords for a remote server logins as part of a multiplayer game. If what you say is true then in this case it should be ok to encrypt/decrypt in Lua since it's only going to happen once for each session (or login attempt).

This also applies to the text editor too, since any delay or 'lag' isn't a huge problem for an exchange of text (rather than say, an FPS game).
Do you recognise when the world won't stop for you? Or when the days don't care what you've got to do? When the weight's too tough to lift up, what do you? Don't let them choose for you, that's on you.
User avatar
iPoisonxL
Party member
Posts: 227
Joined: Wed Feb 06, 2013 3:53 am
Location: Australia
Contact:

Re: Text Editor

Post by iPoisonxL »

Maybe you could add a simple HTML syntax highlighting? You know, highlight whatever is between <> brackets in blue or something.
That'd be pretty cool, IMO.

Code: Select all

      L
    L Ö
    Ö V
L Ö V E
Ö B E
V E
E Y
Website
ArunHaridas
Prole
Posts: 2
Joined: Mon Apr 15, 2013 6:13 pm

Re: Text Editor

Post by ArunHaridas »

I got a error message when run it
cannot create canvas : Not supported by your open gl implementation

Help....
Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot] and 0 guests