native.newTextField is not covered when implemented with composer.showOverlay

native.newTextField is not disappearing when implemented with composer.showOverlay

all other object can be covered ( disappear ) by the Overlay layer .

i am using an image with full size of the screen to cover the previous scene. 

i tried setting alpha of the native.newTextField to 0 then change it back to 1 when scene:resume and here is what happen

it changed the alpha to 0 but when scene:resume and try to set back the native.newTextField it never showed and once i clik inside the native.newTextField it start to show .

am i make scene ?

native.newTextField() is a native object. It sits on top of the Corona OpenGL layer. You have to manually hide the text field when you show the overlay and when the overlay closes, un-hide the text field.

Rob

Thanks Rob . i understand now

is there is another way for input Field other than native?

No.

Not in a Pratical way, you just the text box out the way

Thank i may use another way which is shifting the location of the native.newTextField() to a location outside the main screen by setting its X and Y

i will check and update this

Thanks

Nop :slight_smile: cant even do that

ok i will stick with what i have

Thanks

Just before you call composer.showOverlay() do a:

myTextField.isVisible = false

That’s the easy part. Getting it to re-show when you hide the overlay takes a little setup. In your parent scene (the one calling the overlay) create a function like:

function scene:showTextField()     myTextField.isVisible = true end

This has to be a function attached to the scene like above.  Then in your overlay’s scene:hide() function call the parent function:

function scene:hide( event )     if ( event.phase == "will" ) then         -- restore menu's buttons         event.parent:showTextField()     else         --     end end

Since this function isn’t using any parameters, you can use either the dot operator or the colon operator, just be consistent.

Rob

 

perfect . actually the trick was the isVisable . i thought using alpha will hide it .

but once i know that the trick is isVisable i used it with

Runtime:addEventListener( "enterFrame",HideAndShowTheIDNumberBox )

the HideAndShowTheIDNumberBox is just a function to hide and show the input field and it works !

Thanks

native.newTextField() is a native object. It sits on top of the Corona OpenGL layer. You have to manually hide the text field when you show the overlay and when the overlay closes, un-hide the text field.

Rob

Thanks Rob . i understand now

is there is another way for input Field other than native?

No.

Not in a Pratical way, you just the text box out the way

Thank i may use another way which is shifting the location of the native.newTextField() to a location outside the main screen by setting its X and Y

i will check and update this

Thanks

Nop :slight_smile: cant even do that

ok i will stick with what i have

Thanks

Just before you call composer.showOverlay() do a:

myTextField.isVisible = false

That’s the easy part. Getting it to re-show when you hide the overlay takes a little setup. In your parent scene (the one calling the overlay) create a function like:

function scene:showTextField()     myTextField.isVisible = true end

This has to be a function attached to the scene like above.  Then in your overlay’s scene:hide() function call the parent function:

function scene:hide( event )     if ( event.phase == "will" ) then         -- restore menu's buttons         event.parent:showTextField()     else         --     end end

Since this function isn’t using any parameters, you can use either the dot operator or the colon operator, just be consistent.

Rob

 

perfect . actually the trick was the isVisable . i thought using alpha will hide it .

but once i know that the trick is isVisable i used it with

Runtime:addEventListener( "enterFrame",HideAndShowTheIDNumberBox )

the HideAndShowTheIDNumberBox is just a function to hide and show the input field and it works !

Thanks