Difference between revisions of "TexturePackFont"
From GiderosMobile
(Created page with "__NOTOC__ <!-- GIDEROSOBJ:Font --> '''Supported platforms:''' File:Platform android.pngFile:Platform ios.pngFile:Platform mac.pngFile:Platform pc.pngFile:Pla...") |
m (Text replacement - "</source>" to "</syntaxhighlight>") |
||
(3 intermediate revisions by 2 users not shown) | |||
Line 6: | Line 6: | ||
=== Description === | === Description === | ||
− | The '''TexturePackFont''' class is used to make | + | The '''TexturePackFont''' class is used to make TexturePack usable as Fonts in TextField. |
=== Example === | === Example === | ||
− | + | <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) | ||
local tf = TextField.new(font, "CCDHHH") | local tf = TextField.new(font, "CCDHHH") | ||
stage:addChild(tf) | stage:addChild(tf) | ||
− | </ | + | </syntaxhighlight> |
+ | |||
+ | === See also === | ||
+ | *[[TexturePack]] | ||
+ | *[[TextField]] | ||
{|- | {|- |
Latest revision as of 14:33, 13 July 2023
Supported platforms:
Available since: Gideros 2021.9
Inherits from: FontBase
Description
The TexturePackFont class is used to make TexturePack usable as Fonts in TextField.
Example
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)
See also
MethodsTexturePackFont.new creates a new TexturePackFont object |
EventsConstants |