FontBase Constants

From GiderosMobile
Revision as of 18:10, 17 November 2023 by MoKaLux (talk | contribs) (Created page with "__NOTOC__ '''Available since:''' Gideros 2011.6<br/> '''Defined by:''' FontBase<br/> ==== FontBase Constants ==== *FontBase.TLF_BOTTOM *FontBase.TLF_BREAKWORDS *FontBase....")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

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)