FontBase Constants
From GiderosMobile
Available since: Gideros 2011.6
Defined by: FontBase
FontBase Constants
- FontBase.TLF_BOTTOM
- FontBase.TLF_BREAKWORDS
- FontBase.TLF_CENTER
- FontBase.TLF_JUSTIFIED
- FontBase.TLF_LEFT
- FontBase.TLF_LTR
- FontBase.TLF_NOBIDI
- FontBase.TLF_NOSHAPING
- FontBase.TLF_NOWRAP
- FontBase.TLF_REF_ASCENT
- FontBase.TLF_REF_BASELINE
- FontBase.TLF_REF_BOTTOM
- FontBase.TLF_REF_DESCENT
- FontBase.TLF_REF_LINETOP
- FontBase.TLF_REF_MEDIAN
- FontBase.TLF_REF_MIDDLE
- FontBase.TLF_REF_TOP
- FontBase.TLF_RIGHT
- FontBase.TLF_RTL
- FontBase.TLF_TOP
- FontBase.TLF_VCENTER
Example
Text wrap
application:setBackgroundColor(0x6c6c6c)
-- some vars
local width = application:getContentWidth()
local height = application:getContentHeight()
local mystring = [[
Some very long text. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed non risus. Suspendisse lectus tortor,
dignissim sit amet, adipiscing nec, ultricies sed, dolor.
xxxxxxxxxxxxxxxxxxxxxTLF_BREAKWORDSxxxxxxxxxxxxxxxxxxxxxxxxTLF_BREAKWORDSxxxxxxxxxxxxxxxxxxxxxxxxTLF_BREAKWORDS,
Some very long text. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed non risus. Suspendisse lectus tortor,
dignissim sit amet, adipiscing nec, ultricies sed, dolor.
Some very long text. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed non risus. Suspendisse lectus tortor,
dignissim sit amet, adipiscing nec, ultricies sed, dolor.
]]
local textfield = TextField.new(nil, mystring)
textfield:setSample(mystring)
textfield:setLayout( {w=width/3, h=height/2, lineSpacing=2, flags=FontBase.TLF_CENTER|FontBase.TLF_BREAKWORDS} )
textfield:setScale(2)
textfield:setPosition(8, 8)
stage:addChild(textfield)