API docs

For most things, you can just use EaselsJS and SoundJS docs. Read below about NanoFL-related features.

Important rules:

  1. Most time you don't need to use cache() method: if your object have none empty filters then NanoFL cache it automatically.
  2. If you need to uncache your object, don't forget to uncache dependent objects too (often this are the parent objects). You can use nanofl.DisplayObjectTools.smartUncache(myObj) for this.
  3. In most cases you don't need to create instances of Bitmap/Button/MovieClip directly. Use generated children classes in src folder for that.

NanoFL classes:

nanofl.Bitmap

Extends createjs.Bitmap. Has no own public fields. Example:

var bmp = new nanofl.Bitmap(nanofl.Player.library.getItem("myBitmap"));
container.addChild(bmp);

nanofl.Button

Extends nanofl.MovieClip. Has no own public fields. Example:

var btn = new nanofl.Button(nanofl.Player.library.getItem("myButton"));
container.addChild(btn);

nanofl.DisplayObjectTools

Helper methods applicable to createjs.DisplayObject.

Static methods

Examples:

nanofl.DisplayObjectTools.smartCache(myMovieClip);
nanofl.DisplayObjectTools.smartUncache(myMovieClip);
var bounds = nanofl.DisplayObjectTools.getOuterBounds(myMovieClip);
var bounds = nanofl.DisplayObjectTools.getInnerBounds(myMovieClip);
nanofl.DisplayObjectTools.dump(myMovieClip);

nanofl.MovieClip

Extends createjs.Container

This is a special container to store layer-related children (automatically when constructed from library symbol). Also can contain children not related to any layer (so you can call addChild() to add your DisplayObject to MovieClip).

Example:

var mc = new nanofl.MovieClip(nanofl.Player.library.getItem("myMovieClip"));
container.addChild(mc);

Fields

Methods

nanofl.Player

This class is accessible anywhere. Use it to control global properties.

Fields

nanofl.SeamlessSoundLoop

Use this class for gapless background music loops. Example:

var music = new nanofl.SeamlessSoundLoop(createjs.Sound.play("mySound"));
...
music.stop();

Methods

nanofl.TextField

This class represent a multi-line and multi-format text on canvas. Example:

var tf = new nanofl.TextField();
tf.text = "My text";

Fields

Methods

nanofl.TextRun

This class represent a piece of text and it's format. Used in TextField to store text blocks.

Fields

Methods


Edit this page at bitbucket