Getting Input from User.
Posted: Wed Jun 03, 2020 9:50 pm
[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 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
Within the update function
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,
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)
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
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
thanks in advance,