Class: Text

createjs. Text

Class related to text.


new Text(value, style [, color])

Parameters:
Name Type Argument Default Description
value string

Text content.

style string

String in CSS format without "color".

color string <optional>
'#000000'

String of "color" in CSS format.

Source:

Extends

Members


alpha :number

Transparency.

Type:
  • number
Inherited From:
Default Value:
  • 1
Source:

lineHeight :number

Height of one line.

Type:
  • number
Source:

lineWidth :number

Width of one line.

Type:
  • number
Source:

mask :createjs.Shape

Get shape instance that has graphics of current mask.

Type:
Inherited From:
Source:

parent :createjs.MovieClip

Current parent instance.

Type:
Inherited From:
Source:

regY :number

X coordinate of the rotation reference point.

Type:
  • number
Inherited From:
Overrides:
Default Value:
  • 0
Source:

rotation :number

Rotation amount (degree).

Type:
  • number
Inherited From:
Default Value:
  • 0
Source:

scaleX :number

Scale in X direction

Type:
  • number
Inherited From:
Default Value:
  • 1
Source:

scaleY :number

Scale in Y direction

Type:
  • number
Inherited From:
Default Value:
  • 1
Source:

skewX :number

X skew factor (degree).

Type:
  • number
Inherited From:
Default Value:
  • 0
Source:

skewY :number

Y skew factor (degree).

Type:
  • number
Inherited From:
Default Value:
  • 0
Source:

text :string|number

Text color.

Allowable values:

  • String of "color" in CSS format
  • 0x000000 - 0xFFFFFF
Type:
  • string | number
Default Value:
  • '#000000'
Source:

text :string

Text content.

Type:
  • string
Source:

textAlign :string

The horizontal alignment of the text field.
This property is like a "text-align" in CSS.

Allowable values:

  • 'left'
  • 'center'
  • 'right'
Type:
  • string
Default Value:
  • 'left'
Source:

x :number

X coordinate of the current position.

Type:
  • number
Inherited From:
Default Value:
  • 0
Source:

y :number

Y coordinate of the current position.

Type:
  • number
Inherited From:
Default Value:
  • 0
Source:

Methods


addEventListener(type, func [, isCapture])

Registers event.

Parameters:
Name Type Argument Default Description
type string

Event type.

func function

Callback when the event fires.
Context 'this' in callback is window.

isCapture bool <optional>
false

Defined for compatibility. Creap.js always ignores it.

Inherited From:
Source:
Returns:

Referece of argument 'func'.

Type
function

dispatchEvent(e)

Fires event.

Parameters:
Name Type Description
e string | createjs.Event

Event type or Event object.

Inherited From:
Source:

removeAllEventListeners( [type])

Unregisters all applicable events.

Parameters:
Name Type Argument Default Description
type string <optional>
''

Registered event type. If it regarded as false, unregister all events.

Inherited From:
Source:

removeEventListener(type, func [, isCapture])

Unregisters event.

Parameters:
Name Type Argument Default Description
type string

Registered event type.

func function

Regitered callback.

isCapture bool <optional>
false

Defined for compatibility. Creap.js always ignores it.

Inherited From:
Source:

setTransform( [x] [, y] [, scaleX] [, scaleY] [, rotation] [, skewX] [, skewY] [, regX] [, regY])

Set values of instance properties.

Parameters:
Name Type Argument Default Description
x number <optional>
0

X coordinate of the current position.

y number <optional>
0

Y coordinate of the current position.

scaleX number <optional>
1

Scale in X direction

scaleY number <optional>
1

Scale in Y direction

rotation number <optional>
0

Rotation amount (degree).

skewX number <optional>
0

X skew factor (degree).

skewY number <optional>
0

Y skew factor (degree).

regX number <optional>
0

X coordinate of the rotation reference point.

regY number <optional>
0

Y coordinate of the rotation reference point.

Inherited From:
Source: