SceneModule Overview
SceneModule Overview
TextAlignmentWrapper

TextAlignmentWrapper

The TextAlignmentWrapper class contains text alignment details.

Example

//============================================================================
// The following example demonstrates how to set text alignment.
//
// Project setup:
// - Insert a 2D Text object
//============================================================================

// Load in the required module
const Scene = require('Scene');

(async function() { // Enable async/await in JS [part 1]

  // Locate the text object in the scene
  const text = await Scene.root.findFirst('2dText0');

  // Set the text alignment
  text.alignment.horizontal = Scene.TextAlignment.LEFT;
  text.alignment.vertical = Scene.VerticalTextAlignment.TOP;

})(); // Enable async/await in JS [part 2]

Properties

PropertyDescription
horizontal
(get) horizontal: StringSignal<TextAlignment>
(set) horizontal: StringSignal<TextAlignment>


Specifies the horizontal text alignment.
vertical
(get) vertical: StringSignal<VerticalTextAlignment>
(set) vertical: StringSignal<VerticalTextAlignment>


Specifies the vertical text alignment.

Methods

This module exposes no methods.

Was this article helpful?