CompositeFont.new: Difference between revisions

From GiderosMobile
No edit summary
No edit summary
Line 1: Line 1:
__NOTOC__
__NOTOC__
'''<translate>Available since</translate>:''' Gideros 2019.1<br/>
'''Available since:''' Gideros 2019.1<br/>
'''<translate>Class</translate>:''' [[Special:MyLanguage/CompositeFont|CompositeFont]]<br/>
'''Class:''' [[CompositeFont]]<br/>


=== Description ===
=== Description ===
Creates a new [[Special:MyLanguage/CompositeFont|CompositeFont]] object.
Creates a new '''CompositeFont''' object.
<source lang="lua">
CompositeFont.new(definition)
</source>


Each layer of the composited font is defined by a table. The following fields are possible:
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)
* font: the font object to use for this layer (mandatory)
* color: The color to use when rendering this layer
* color: the color to use when rendering this layer
* alpha: The alpha value to use with the color
* alpha: the alpha value to use with the color
* 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)
* 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">
CompositeFont.new(definition)
</source>


=== Parameters ===
=== Parameters ===

Revision as of 22:31, 5 June 2023

Available since: Gideros 2019.1
Class: CompositeFont

Description

Creates a new CompositeFont object.

CompositeFont.new(definition)

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.

Parameters

definition: (table) a list of layer definition tables