I am using native.newTextField to display text fields/boxes for the names of seven players to be inputted. I want to left justify the text after input as well as put the text boxes in a display group. The sample code is below.
After editing the text either in the simulator or on an Andriod device, the inputted text will not left justify if the text is longer than the length of the visible box. I could limit the characters for just the amount of characters that will fit in the length of box, but I would rather not do that.
Also, the text field does not honor the display group when I do MainPage.isVisible = false. All the other objects I put in the Main Page display group will disappear when I do MainPage.isVisible = false.
Any tips on the left justifying and using display groups with native.newTextField?
local PlayerBox = { }
local MainPage = display.newGroup()
local i
for i=1,7,1 do
PlayerBox[i] = native.newTextField(95+((i-1)*190), 310, 188, 55 )
PlayerBox[i].id = i
PlayerBox[i].font = native.newFont( native.systemFontBold, 36 )
PlayerBox[i].align = “left”
PlayerBox[i].isEditable = true
PlayerBox[i].placeholder = “NAME”
PlayerBox[i]:addEventListener( “userInput”, PlayerBoxListener)
MainPage:insert(PlayerBox[i])
end