Difference between revisions of "CompositeFont.new"

From GiderosMobile
Line 12: Line 12:
 
* x: The X offset to apply
 
* x: The X offset to apply
 
* y: The Y offset to apply
 
* y: The Y offset to apply
 +
* name: A name for this layer (since 2021.9)
  
 
'''Note''': TTFont without any character list specification aren't supported in composite fonts.
 
'''Note''': TTFont without any character list specification aren't supported in composite fonts.
  
 
<source lang="lua">
 
<source lang="lua">
CompositeFont.new{definition} -- *** PLEASE NOTICE THE CURLY BRACES { } INSTEAD OF ( ) ***
+
(font) = CompositeFont.new(definition)  
 
</source>
 
</source>
  
'''Note 2''': CompositeFont uses curly braces '''{ }''' instead of parenthesis ( ).
+
=== Parameters ===
 +
'''definition''': (table) a list of table describing each layer of the font.<br/>
  
 
=== Parameters ===
 
=== Parameters ===

Revision as of 17:20, 6 September 2021

Available since: Gideros 2019.1
Class: CompositeFont

Description

Creates a new CompositeFont object.

Each layer of the composited font is defined by a table. The following fields are possible:

  • font: The font object to use for this layer (mandatory)
  • color: The color to use when rendering this layer
  • alpha: The alpha value to use with the color
  • x: The X offset to apply
  • y: The Y offset to apply
  • name: A name for this layer (since 2021.9)

Note: TTFont without any character list specification aren't supported in composite fonts.

(font) = CompositeFont.new(definition)

Parameters

definition: (table) a list of table describing each layer of the font.

Parameters

definition: (table) a list of layer definition tables