Page 1 of 1

Getting Input from User.

Posted: Wed Jun 03, 2020 9:50 pm
by Afrricyn
[SOLVED]
Hello Fellow Lovers,
New to Lua and Love2d, so I'm having trouble trying to get input from the user, I looked on the website and I found

Code: Select all

function love.textinput(t)
however, I'm not sure how to implement that into my situation or even use it.
I'm trying to if a save is "[EMPTY]" and the user presses 'enter', it should take their next inputs until the length is longer or equal to 3 and then change the save name from "[empty]" to what they entered
Image

Within the update function

Code: Select all

if love.keyboard.wasPressed("enter") or love.keyboard.wasPressed("return") then
        if save[highlighted] == "[EMPTY]" then
            -- save[highlighted] = [inputted text from user]
        end
end
once they've entered the text, I would also like to substring it to 3 characters and then upper it to capitals but I have no clue how?
thanks in advance,

Re: Getting Input from User.

Posted: Thu Jun 04, 2020 2:03 pm
by Afrricyn
[SOLVED] - managed to do it.

Re: Getting Input from User.

Posted: Fri Jun 12, 2020 8:58 am
by Jeeper
A friendly tip is to always include the solution that you found and are using. Because when other people search for a similar thing all they find is that you solved it, but not how.