It is essentially a example code from API documentation :
local function onUsername( event )
if ( “began” == event.phase ) then
elseif ( “submitted” == event.phase ) then
native.setKeyboardFocus( password )
end
end
local function onPassword( event )
if ( “submitted” == event.phase ) then
native.setKeyboardFocus( nil )
end
end
function getPassword() – obrazovka pro zadání jména a hesla
status = “login”
backpass = display.newImage(img…“back.png”)
backpass.anchorX = 0.5 backpass.anchorY = 0
backpass.xScale = 1.2 backpass.yScale = 1.2
backpass.x = nx/2 backpass.y = -150
n = 100
username = native.newTextField( nx/2+55, 750+n, 590, 100 )
username.font = native.newFont( native.systemFontBold, 48)
username.text = “”
username.hasBackground = false
username:addEventListener( “userInput”, onUsername )
username : setTextColor(1,1,1)
password = native.newTextField( nx/2+55, 900+n, 590, 100 )
password.font = native.newFont( native.systemFontBold, 48 )
password.text = “”
password.isSecure = true
password.hasBackground = false
password:addEventListener( “userInput”, onPassword )
usericon = display.newImage(img…“iconUser_blue.png”)
usericon.anchorX = 0 usericon.anchorY = 0.5
usericon.x = nx/2-323 usericon.y = 750+n
passicon = display.newImage(img…“iconLock_blue.png”)
passicon.anchorX = 0 passicon.anchorY = 0.5
passicon.x = nx/2-317 passicon.y = 900+n
button = display.newRect(nx/2,1070+n,700,100)
button:setFillColor(0.3, 0.3, 0.3)
button.alpha = 0.1
buttontext = display.newText(“LOGIN”,nx/2,1070+n,myFontBold,48)
buttontext : setTextColor(0.6, 0.6, 0.6)
button : addEventListener(“tap”,testPass)
end
At your instigation that I am tested separately, and everything works. I’m beginning to be unhappy
I have no idea what that might influence