Class: Content

Creap. Content

Class related to content data for Creap.js.


new Content(lib, root, images, ss, basePath)

Create content data from js file built by animate CC.

Parameters:
Name Type Description
lib string

Name of library object. (Maybe, named 'lib')

root string

Name of the root object in library object.

images string

Name of images object. (Maybe, named 'images')

ss string

Name of sprite sheet object. (Maybe, named 'ss')

basePath string

Basement path of aseets.

Source:

Methods


createJson( [imageDirName] [, systemFile])

Create json file for sprite sheet image.
This json file is like a created by SpritePacker.

This function runs synchronously. In other words, it stops processing until all the json files are created.

Parameters:
Name Type Argument Default Description
imageDirName <optional>
images

Image directory name.

systemFile string <optional>
./ssJsonMaker.php

Path that system file to create json file.
Specify the URL where the system that outputs json file is located.

Source:
Returns:

Return a itself (can use method chaining).

Type
Creap.Content

defineImages(obj)

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

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

key: Image identifier
value: Images URL.

Source:
Returns:

Return a itself (can use method chaining).

Type
Creap.Content

defineSounds(obj)

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

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

key: Sound identifier
value: Sound URL.

Source:
Returns:

Return a itself (can use method chaining).

Type
Creap.Content

defineVars(obj)

Define variables to instance of root object.
Timing of definition is when this content passed to constructor of Creap.Application.

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

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

Source:
Returns:

Return a itself (can use method chaining).

Type
Creap.Content

disabledImages(list)

Unregister images in the content.
Used when there is an unnecessary image as a result of executing replaceMovieClip.

Parameters:
Name Type Description
list array.<string>

Values of 'id' in object that is registered lib.properies.manifest.

Source:
See:
Returns:

Return a itself (can use method chaining).

Type
Creap.Content

replaceClips(obj)

Replace definitions in the content to one in other content.

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

key: Name of definition to change in content.
value: Data related to replace in other content.

Source:
See:
Returns:

Return a itself (can use method chaining).

Type
Creap.Content

spriteToBitmap(libName, imageName)

Change DisplayObject defined as sprite to Bitmap definition.
It is mainly used to replace only a part of the image contained in the sprite sheet.

Parameters:
Name Type Description
libName string

Name of definition to change in content.

imageName string

Image identifier.

Since:
  • 1.1.0
Source:
Returns:

Return a itself (can use method chaining).

Type
Creap.Content