How To Make A Text Editor?

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
User avatar
Cauan
Prole
Posts: 22
Joined: Thu Mar 09, 2023 5:58 pm

How To Make A Text Editor?

Post by Cauan »

Hi, I'm doing (or trying) a engine with LOVE and me don't find nothing.
can u help me pls :? :? :cry:
I'm me, and you are you
User avatar
knorke
Party member
Posts: 238
Joined: Wed Jul 14, 2010 7:06 pm
Contact:

Re: How To Make A Text Editor?

Post by knorke »

User avatar
Cauan
Prole
Posts: 22
Joined: Thu Mar 09, 2023 5:58 pm

Re: How To Make A Text Editor?

Post by Cauan »

I try it, gives me error, and when i press a key in keyboard, don't show anything!!

Code: Select all

If anyMistake('sorry me, English is not my language!') then
F = 'Okay?'
End

I'm me, and you are you
User avatar
knorke
Party member
Posts: 238
Joined: Wed Jul 14, 2010 7:06 pm
Contact:

Re: How To Make A Text Editor?

Post by knorke »

This code example from the manual works:

Code: Select all

function love.load()
    text = "Type away! -- "
end

function love.textinput(t)
    text = text .. t
end

function love.draw()
    love.graphics.printf(text, 0, 0, love.graphics.getWidth())
end
If there is an error then you need to show the error. Otherwise nobody can help.

Your three code lines do not work because:
You typed "If" and "End" but it has to be lower case, as you can see in the example.
You set a variable "F" but never do anything with it.
You call a function "anyMistake" but where is that function defined? Or is it just non-sense pseudo code?
Post Reply

Who is online

Users browsing this forum: Bing [Bot] and 47 guests