native.newTextBox Questions

I’m trying to make a text box, but no matter what I change their is always a background blur and blue glowing box around the text, is there a way to get rid of these?

local function fieldHandler( textField ) return function( event ) if ( "began" == event.phase ) then elseif ( "ended" == event.phase ) then elseif ( "editing" == event.phase ) then elseif ( "submitted" == event.phase ) then native.setKeyboardFocus( nil ) end end end SearchTxt = native.newTextField( display.contentCenterX + 190, 313, 140, 35 ) SearchTxt.align = "center" SearchTxt.hasBackground = false SearchTxt:setTextColor(.7,.4,.2) native.setKeyboardFocus( nil ) SearchTxt:addEventListener( "userInput", fieldHandler( function() return SearchTxt end ) )

I’m not 100% sure what affect you’re going for, but try this:

SearchTxt:setFillColor(0,0,0,0) -- Should hide box while still showing text.

I get an error (Attempt to call method ‘setFillColor’ (a nil value)) when I do that, but after testing it on a phone the box and blur don’t show up. Is there any reason for it showing up on simulator?

My bad, I looked at the docs and I think you should do this instead

https://docs.coronalabs.com/daily/api/type/TextField/index.html

I was mainly trying to get rid of the blue glow around the text box, but since it works fine on the phone I’ll just mark it as solved

Here is an example of a textfield that works in one of my apps.

usernameField = native.newTextField( centerX, centerY - 20, 200, 36) usernameField.font = native.newFont( "Gotham", 25 ) usernameField.text = "" usernameField.align = "center" usernameField.placeholder = "Nickname..." usernameField:setTextColor( 0, 0, 0, 0) usernameField.inputType = "default" usernameField.hasBackground = false usernameField:addEventListener( "userInput", onNickEditing )

I’m not 100% sure what affect you’re going for, but try this:

SearchTxt:setFillColor(0,0,0,0) -- Should hide box while still showing text.

I get an error (Attempt to call method ‘setFillColor’ (a nil value)) when I do that, but after testing it on a phone the box and blur don’t show up. Is there any reason for it showing up on simulator?

My bad, I looked at the docs and I think you should do this instead

https://docs.coronalabs.com/daily/api/type/TextField/index.html

I was mainly trying to get rid of the blue glow around the text box, but since it works fine on the phone I’ll just mark it as solved

Here is an example of a textfield that works in one of my apps.

usernameField = native.newTextField( centerX, centerY - 20, 200, 36) usernameField.font = native.newFont( "Gotham", 25 ) usernameField.text = "" usernameField.align = "center" usernameField.placeholder = "Nickname..." usernameField:setTextColor( 0, 0, 0, 0) usernameField.inputType = "default" usernameField.hasBackground = false usernameField:addEventListener( "userInput", onNickEditing )