Class: Application

Creap. Application

Plug-in created using pixi.js for playing createjs content built by animate CC.


new Application(content [, container] [, options])

Create an application from instance of Creap.Content.

Parameters:
Name Type Argument Default Description
content Creap.Content

Target content.

container HTMLElement <optional>
document.body

The parent element of the canvas that displays the content.

options Creap.ApplicationOption <optional>

Optional data related to Creep.Application.

Source:
Fires:

Extends

  • Emitter

Members


app :PIXI.Application

Target application.

Type:
  • PIXI.Application
Source:

container :HTMLElement

Container element.

Type:
  • HTMLElement
Source:

content :Creap.Content

Target content.

Type:
Source:

isBuilt :bool

Whether application was bulit.
"built" means that the root of the content has been instantiated.

Type:
  • bool
Source:

isInitialized :bool

Whether application was initialized.
"initialized" refers to whether all the assets required for the content have been loaded.

Type:
  • bool
Source:

isStarted :bool

Whether application was start.
"start" means that the application's ticker has started.

Type:
  • bool
Source:

stage :createjs~Stage

Top level container in application.

Type:
Source:

view :HTMLCanvasElement

Target canvas.

Type:
  • HTMLCanvasElement
Source:

wrapper :HTMLDivElement

Wrapper element.

Type:
  • HTMLDivElement
Source:

Methods


adjustHeight(width)

Adjust height of the content.
This function changes "canvas.style.height".

Parameters:
Name Type Description
width number
Since:
  • 1.1.0
Source:
Returns:

Return a itself (can use method chaining).

Type
Creap.Application

adjustWidth(width)

Adjust width of the content.
This function changes "canvas.style.width".

Parameters:
Name Type Description
width number
Since:
  • 1.1.0
Source:
Returns:

Return a itself (can use method chaining).

Type
Creap.Application

defineBitmap(libName, imageName)

Define a new bitmap symbol.
It is mainly used when the number of images to be inserted from the outside is not fixed.
If the quantity is fixed, please use Creap.Content#defineImages or Creap.Application#defineImages and replace the image.

Parameters:
Name Type Description
libName string

Name of definition to change in content.

imageName string

Image identifier.

Since:
  • 1.1.7
Source:
See:
Returns:

Return a itself (can use method chaining).

Type
Creap.Content

defineImages(obj, callback)

Define images to the content.
If already defined, replace that definition.

Parameters:
Name Type Description
obj object.<string, ImageDefinitionData> | object.<string, string>

key: Image identifier
value: Image definition data | Image URL.

callback function

Callback when images loaded.
Context 'this' in callback is Creap.Application.

Since:
  • 1.1.0
Source:
Returns:

Return a itself (can use method chaining).

Type
Creap.Application

defineVars(obj)

Define variables to instance of root object.

Parameters:
Name Type Description
obj object.<string, *>

key: Name of variable.
value: Value of variable.

Since:
  • 1.1.0
Source:
Returns:

Return a itself (can use method chaining).

Type
Creap.Application

fullScreen()

Display the content in full screen.

Source:
Returns:

Return a itself (can use method chaining).

Type
Creap.Application

getPoint()

Get the top-left coordinates of the application.

Since:
  • 1.1.0
Source:
Returns:
Type
Creap.Point

getRect()

Gets a rectangle representing the display area of the application.

Since:
  • 1.1.0
Source:
Returns:
Type
Creap.Rect

getSize()

Get the size of the application.

Since:
  • 1.1.0
Source:
Returns:
Type
Creap.Size

hide()

Hide the content.

Since:
  • 1.1.0
Source:
Returns:

Return a itself (can use method chaining).

Type
Creap.Application

pause(isPause)

Pause or restart the content.

Parameters:
Name Type Description
isPause bool
Since:
  • 1.1.0
Source:
Returns:

Return a itself (can use method chaining).

Type
Creap.Application

show()

Show the content.

Since:
  • 1.1.0
Source:
Returns:

Return a itself (can use method chaining).

Type
Creap.Application

start()

Build and start the content.

Source:
Fires:
Returns:

Return a itself (can use method chaining).

Type
Creap.Application

stop()

Stop the content.

Source:
Fires:
Returns:

Return a itself (can use method chaining).

Type
Creap.Application

toBottom( [rect])

Align the content to the bottom with respect to the vertical direction of the reference rectangle.
This function changes "canvas.parentNode.style.top".

Parameters:
Name Type Argument Default Description
rect Creap.Rect <optional>
new Rect(0, 0, windowWidth, windowHeight)

Reference rectangle.

Since:
  • 1.1.0
Source:
Returns:

Return a itself (can use method chaining).

Type
Creap.Application

toCenter( [rect])

Align the content to the center with respect to the horizontal direction of the reference rectangle.
This function changes "canvas.parentNode.style.left".

Parameters:
Name Type Argument Default Description
rect Creap.Rect <optional>
new Rect(0, 0, windowWidth, windowHeight)

Reference rectangle.

Since:
  • 1.1.0
Source:
Returns:

Return a itself (can use method chaining).

Type
Creap.Application

toLeft( [rect])

Align the content to the left with respect to the horizontal direction of the reference rectangle.
This function changes "canvas.parentNode.style.left".

Parameters:
Name Type Argument Default Description
rect Creap.Rect <optional>
new Rect(0, 0, windowWidth, windowHeight)

Reference rectangle.

Since:
  • 1.1.0
Source:
Returns:

Return a itself (can use method chaining).

Type
Creap.Application

toMiddle( [rect])

Align the content to the center with respect to the vertical direction of the reference rectangle.
This function changes "canvas.parentNode.style.top".

Parameters:
Name Type Argument Default Description
rect Creap.Rect <optional>
new Rect(0, 0, windowWidth, windowHeight)

Reference rectangle.

Since:
  • 1.1.0
Source:
Returns:

Return a itself (can use method chaining).

Type
Creap.Application

toRight( [rect])

Align the content to the right with respect to the horizontal direction of the reference rectangle.
This function changes "canvas.parentNode.style.left".

Parameters:
Name Type Argument Default Description
rect Creap.Rect <optional>
new Rect(0, 0, windowWidth, windowHeight)

Reference rectangle.

Since:
  • 1.1.0
Source:
Returns:

Return a itself (can use method chaining).

Type
Creap.Application

toTop( [rect])

Align the content to the top with respect to the vertical direction of the reference rectangle.
This function changes "canvas.parentNode.style.top".

Parameters:
Name Type Argument Default Description
rect Creap.Rect <optional>
new Rect(0, 0, windowWidth, windowHeight)

Reference rectangle.

Since:
  • 1.1.0
Source:
Returns:

Return a itself (can use method chaining).

Type
Creap.Application