Text

components/meshes/ Text



Physics text object can be convex or concave. By default it's convex but you can also switch to concave.

Constructor

.new Text(paramsopt)

Text class is made for creating 3D text objects.

Source:
Parameters:
Name Type Attributes Description
params Object <optional>

The params.

Example

Creating a Text, and adding it to app

new Text({
    text: 'Some text',
    parameters: {
      font: 'path/to/font.typeface.js',
      size: 20,
      height: 5,
      curveSegments: 6
    }
  },

  material: new THREE.MeshBasicMaterial({
    color: 0xffffff
  }),

  position: {
    x: -40,
    y: 20,
    z: 0
  }
}).addTo(app);

Extends module:core.MeshComponent

Members

(private) ._wait :Array

Array of promises that should be resolved before Component is ready.

Inherited From:
Source:

.children :Array

Collection of child Components.

Inherited From:
Source:

.defaults :Object

Default values for parameters

Overrides:
Default Value:
                  
    {
      text: 'Hello World!',
      font: null,
    
      geometry: {
        size: 12,
        height: 50,
        curveSegments: 12,
        font: new Font(),
        bevelEnabled: false,
        bevelThickness: 10,
        bevelSize: 8
      }
    }
    
Source:

.instructions :Object

Static instructions

Inherited From:
Default Value:
                  {
      position: ['x', 'y', 'z'],
      rotation: ['x', 'y', 'z'],
      scale: ['x', 'y', 'z']
    }
                
Source:

.isDeffered :Boolean

Returns whether the object is async (wait promises are more than 0).

Inherited From:
Source:

.loader :Object

Default FontLoader

Default Value:
                  new FontLoader()
                
Source:

.manager :ModuleManager

Returns the ModuleManager used for this component.

Inherited From:
Source:

.modules :Array

Collection of modules.

Inherited From:
Source:

.native :Object

Returns the native object used for this component.

Inherited From:
Source:

Methods

(static) .build(params) → {THREE.Mesh}

Build is called as part of the lifecycle to create a mesh using input params.

Source:
Parameters:
Name Type Description
params Object

Component parameters.

(static) .load(path) → {Promise}

load() preloads a Font object and returns a Promise with it.

Source:
Parameters:
Name Type Description
path String

Path to the font

.add(object) → {Promise}

Add a child Component.

Inherited From:
Source:
Parameters:
Name Type Description
object Component

Component that should be added as a child.

.addTo(object)

Adds this Component to specified App/Component.

Inherited From:
Source:
Parameters:
Name Type Description
object Component

Component that will be a parent of this.

.clone() → {MeshComponent}

Make a clone of this MeshComponent using .copy()

Inherited From:
Source:

.copy() → {this}

Copy source transforms & execute Component.copy()

Inherited From:
Source:

.defer(func)

Execute func (Callback) when Component is ready.

Inherited From:
Source:
Parameters:
Name Type Description
func function

Callback.

.remove(object)

Remove a child Component.

Inherited From:
Source:
Parameters:
Name Type Description
object Component

Component that should be a child of this Component.

.updateParams() → {Object}

Updates parameters of the Component.

Inherited From:
Source:

.wait(promiseopt) → {Promise}

Wait for a promise.

Inherited From:
Source:
Parameters:
Name Type Attributes Description
promise Promise <optional>

The promise that should be added to a queue.

.wrap() → {Promise}

Wraps transforms (position & rotation)

Inherited From:
Source: