Hey guys, look at this chunk of code and see if you spot any problem. I couldnt. The text shows perfectly on simulator but on the iphone test it doesnt
FYI the text I am talking about is “4 characters or more”.
local alertMSGchar = native.newTextBox( centerX , centerY + 25, 250, 36) alertMSGchar.font = native.newFont( "Gotham", 15 ) alertMSGchar.align = "center" alertMSGchar.text = "4 or more characters" alertMSGchar.hasBackground = false alertMSGchar:setTextColor(0, 0, 0, 0) local function onNickEditing(event) if event.phase == "began" then if (string.len(event.target.text) \< 4) then alertMSGchar:setTextColor(1, 0, 0, 1) end if (string.len(event.target.text) \>= 4) then alertMSGchar:setTextColor(0, 1, 0, 1) end elseif event.phase == "editing" then if (string.len(event.target.text) \> 8) then event.target.text = event.target.text:sub(1, 8) end if (string.len(event.target.text) \< 4) then alertMSGchar:setTextColor(1, 0, 0, 1) end if (string.len(event.target.text) \>= 4) then alertMSGchar:setTextColor(0, 1, 0, 1) end elseif event.phase == "ended" then if (string.len(event.target.text) \< 4) then event.target.text = "" end end end local function clearKeyboard() native.setKeyboardFocus(nil) alertMSGchar:setTextColor( 0, 0, 0, 0 ) end display.currentStage:addEventListener( "tap", clearKeyboard )
TY for the help