okay here is my question where can i find more information about input text so love can store my variables when i input them as string ???
also to delete letters or to type them here is an example i saw it in another tutorial but didn't give the full details just this
function love.load()
g =love.graphics
name = ""
end
function love.update()
end
function love.keypressed( key, unicode )
if ( unicode > 31 and unicode < 127 ) then
name = name .. string.char( unicode )
end
end
function love.draw()
g.print( "Name: " .. name, 800/2, 600/2 )
end
wonder whats string.char(unicode)
and why it can only go to 127???? ( unicode > 31 and unicode < 127 )
also how can you delete a letter u didn't want to input like using backspace???
any help will be appreciated or articles or something trying to make a game where the player can input text
Okay, I'll try to simplify it:
The (unicode > 31 and unicode < 127 ) checks if the code of the char you're using fits UTF-8, because those are the only chars Lua supports. It was probably added to avoid crashes on the game. Although I'm not entirely sure if all these chars are included only between 31 and 127. The (string.char(unicode) ) part replaces the unicode by it's relative char. This way you can get the right char (for example, uppercase ones) even if it is in the same key. To erase a char is very simple. Add this to love.keypressed():
ohhhh so its no more valid to use that way?? in 0.9.0 ???
so i am sure its better now? we can uppercase and delete a letter we type hope wiki explains it good ill check it out ...