Description

Compress all children in an HTML5Canvas

Usage

Parameters

  • w {Integer}

    Width of the compressed child

  • h {Integer}

    Height of the compressed child

  • free_memory {Boolean} optional

    (optional) Do not keep the array in memory of the children if true. Unpack method can no longer be used out. (false by default)

Returns

CanvasEngine.Element

Example

In method ready

var el = this.createElement(), child;
for (var i=0 ; i < 1000 ; i++) {
    child = this.createElement();
    child.x = i;
    el.append(child);
}
el.pack(10, 1000);
stage.append(el);

Discussion