Difference between revisions of "TexturePackFont"

From GiderosMobile
m (Text replacement - "<source" to "<syntaxhighlight")
Line 9: Line 9:
  
 
=== Example ===
 
=== Example ===
<source lang="lua">
+
<syntaxhighlight lang="lua">
 
local tp = TexturePack.new({"coin.png", "diamond.png", "heart.png"})
 
local tp = TexturePack.new({"coin.png", "diamond.png", "heart.png"})
 
local font = TexturePackFont.new(tp,{C="coin.png", D="diamond.png", H="heart.png"},0.5)
 
local font = TexturePackFont.new(tp,{C="coin.png", D="diamond.png", H="heart.png"},0.5)

Revision as of 15:31, 13 July 2023

Supported platforms: Platform android.pngPlatform ios.pngPlatform mac.pngPlatform pc.pngPlatform html5.pngPlatform winrt.pngPlatform win32.png
Available since: Gideros 2021.9
Inherits from: FontBase

Description

The TexturePackFont class is used to make TexturePack usable as Fonts in TextField.

Example

<syntaxhighlight lang="lua"> local tp = TexturePack.new({"coin.png", "diamond.png", "heart.png"}) local font = TexturePackFont.new(tp,{C="coin.png", D="diamond.png", H="heart.png"},0.5) local tf = TextField.new(font, "CCDHHH") stage:addChild(tf) </source>

See also

Methods

TexturePackFont.new creates a new TexturePackFont object

Events

Constants