Skip to content

@modoki/engine / index / Text2D

Variable: Text2D

const Text2D: Trait<{ align: string; anchorX: number; anchorY: number; color: number; font: string; fontSize: number; glowColor: number; glowSize: number; glowStrength: number; isVisible: boolean; letterSpacing: number; lineSpacing: number; maxWidth: number; opacity: number; orderInLayer: number; outlineColor: number; outlineOpacity: number; outlineWidth: number; shadowColor: number; shadowOffsetX: number; shadowOffsetY: number; shadowOpacity: number; shadowSoftness: number; text: string; weight: number; }>

SDF text on the 2D (PixiJS) layer. Same MSDF atlas + shader as Text3D, rendered as a Pixi mesh under a Canvas2D. fontSize is in pixels.

Built with Modoki.