I would like to have the user input text before s/he can progress to the next scene.
I’ve been able to accomplish this previously with check mark boxes. But I can’t seem to figure it out with input text boxes.
Here is what I have tried thus far (resulting in many errors).
local mainGroup = display.newGroup() myText = display.newText( "Enter your full name", 500, 350, native.systemFont, 38 ) nameField = native.newTextField( 500, 400, 320, 36 ) nameField.inputType = "name" nameField:setReturnKey( "done" ) nameField.isVisible = true myText.isVisible = true local function onTextInput( event ) local userInput(event) = event.target if switch.isOn == true then score = score + 1 elseif switch.isOn == false then score = score - 1 end mainGroup:insert(nameField) mainGroup:insert(myText)
I’m trying to assign a value (or score) of 1. If that value is there the user can pass.
Looking at my own code I know it’s wrong but I have no clue how to fix this?