Remove Border Around textField

6 replies [Last post]
Jel's picture
Jel
User offline. Last seen 3 weeks 5 days ago. Offline
Joined: 10 Jan 2011

Hi,

As far as I can tell it is not possible to remove the border around the native.textField.

If someone does know how to do this please can you let me know.

Thanks Jel

Replies

hgvyas123's picture
hgvyas123
User offline. Last seen 1 week 1 day ago. Offline
Joined: 12 Dec 2010

may be you can do something like

1
2
3
4
5
6
7
8
9
local textfield = native.newTextField(0,0,200,100)
local myText = display.newText("here",0,200,nil,36)
myText:setReferencePoint(display.TopLeftReferencePoint)
 
local function callMe()
        myText.text = textfield.text
        myText:setReferencePoint(display.TopLeftReferencePoint)
end
Runtime:addEventListener("enterFrame",callMe)

just take textbox to outside of the screen and put dummy textbox to show text on it if that can feet with your need

:)

Jel's picture
Jel
User offline. Last seen 3 weeks 5 days ago. Offline
Joined: 10 Jan 2011

Thanks hgvyas123,

Your a star. It actually answered another question I had about outputting text from the textFields

Jel

Jel's picture
Jel
User offline. Last seen 3 weeks 5 days ago. Offline
Joined: 10 Jan 2011

Sorry one more question. How would I change the font ?

You can tell I'm a newbie.

hgvyas123's picture
hgvyas123
User offline. Last seen 1 week 1 day ago. Offline
Joined: 12 Dec 2010

hi welcome and no need to sorry,

chk this link for fonts

http://developer.anscamobile.com/content/display-objects#Using_a_custom_font

:)

aliennude
User offline. Last seen 2 days 23 hours ago. Offline
Joined: 23 Sep 2011

I´m trying to have understand your code, but I don´t fully understand it. What I´m trying to do is have a textfield that is fully invisible(also the frame border) and so far I have:

1
2
3
local textBox = native.newTextField( 210, 200, 100, 30, txtList)
textBox:setTextColor(0, 0, 0, 255 )
textBox.hasBackground = false

Could you give an example on how to remove the border on this textfield?

thanks

hgvyas123's picture
hgvyas123
User offline. Last seen 1 week 1 day ago. Offline
Joined: 12 Dec 2010

basically in above code textbox is outside of the screen and we are continuously taking the value in it to our text so no issue of border ( i have not tested above code still!!!!)

:)

Viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.