TextField

From GiderosMobile
Revision as of 14:19, 23 August 2018 by Hgy29 (talk | contribs)

Supported platforms: android, ios, mac, pc
Available since: Gideros 2011.6

Description


The TextField class is used to create display objects for text display.

Examples

Example

local font = Font.new("myfont.txt", "myfont.png")

local textfield = TextField.new(font, "some text")

stage:addChild(textfield)

textfield:setText("some other text")		-- change the text

-- to use the default font, pass nil value for the font parameter
local textfield2 = TextField.new(nil, "some other text with default font")

Methods

TextField.new Template:Creates a new TextField object with the specified font and text
TextField:getLayout Template:Retrieve the layout parameters of this Textfield
TextField:getLetterSpacing Template:Returns the letter-spacing property which is used to increase or decrease the space between characters in a text
TextField:getLineHeight Template:Get line height
TextField:getSample Template:Get string that was used as sample for determining line height
TextField:getText Template:Returns the text displayed
TextField:getTextColor Template:Returns the color of the text in a text field in hexadecimal format
TextField:setFont Template:Set font to use
TextField:setLayout Template:Change the layout parameters for this TextField
TextField:setLetterSpacing Template:Sets the letter-spacing property which is used to increase or decrease the space between characters in a text
TextField:setSample Template:Set string that will be used as sample for determining text's line height
TextField:setText Template:Sets the text to be displayed
TextField:setTextColor Template:Sets the color of the text in a text field in hexadecimal format

Events

Constants