Hey all, I posted this in the general section, but it seems like it belongs here:
I’ve created a native.newTextBox with a width of 800px. I want to be able to dynamically move and change the width of this textbox to 400px when I click a button and then change it back to 800px when I click it again. The problem is that the textbox keeps shrinking every time a click the button and never reverts back to the 800px.
My code for the button to control the textbox is as follows:
if ( “ended” == event.phase ) then
if ButtonName == “Tab1” then
print( “Button was pressed and released” )
if (textBox.x>100) then
transition.to( textBox, { x=50, width=860, time=200 } )
else
transition.to( textBox, { x=400, width=500, time=200 } )
end
end
end
How do I change the width of this native.newTextBox on fly?
Thanks!