跳到主要内容

Txt

Text component.

Properties

PropertyTypeDescription
textSimpleSignal<string, this>Text content
fontSizeSimpleSignal<number, this>Font size
fontFamilySimpleSignal<string, this>Font family
fontWeightSimpleSignal<number, this>Font weight
fontStyleSimpleSignal<string, this>Font style
lineHeightSimpleSignal<number, this>Line height
alignSimpleSignal<string, this>Alignment

Examples

import {Txt} from '@wangyaoshen/locus';

const text = new Txt({
text: 'Hello, World!',
fontSize: 48,
fill: 'white',
});