I can successfully create new text fields, but I’m not sure how to actually use the input data. Once the user types in something in the text field, how do i use that text? I know I can use the CrawlSpace library to easily save the data, but I don’t know how to get from the input to save. Any help would be appreciated. [import]uid: 11144 topic_id: 12644 reply_id: 312644[/import]
This is what I did:
local function playerNameCallback(event)
if ( "submitted" == event.phase ) or ( "ended" == event.phase) then
playerName = playerNameField.text
native.setKeyboardFocus( nil )
saveSettings()
end
end
then later when I’m building my screen…
playerNameField = native.newTextField( 52, 170, 200, 28, playerNameCallback )
playerNameField.text = playerName
playerNameField.x = display.contentWidth / 2
settingsGroup:insert(playerNameField)
[import]uid: 19626 topic_id: 12644 reply_id: 46260[/import]
thanks. that gives me some ideas to play around with. [import]uid: 11144 topic_id: 12644 reply_id: 46265[/import]