Skip to content

Commit

Permalink
Updated NEXT docs and libs
Browse files Browse the repository at this point in the history
  • Loading branch information
Lanny McNie committed May 27, 2015
1 parent b15c866 commit d59298c
Show file tree
Hide file tree
Showing 6 changed files with 108 additions and 31 deletions.
Binary file modified docs/easeljs_docs-NEXT.zip
Binary file not shown.
45 changes: 33 additions & 12 deletions lib/easeljs-NEXT.combined.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ this.createjs = this.createjs||{};
*
* function MySubClass() {}
* createjs.extend(MySubClass, MySuperClass);
* ClassB.prototype.doSomething = function() { }
* MySubClass.prototype.doSomething = function() { }
*
* var foo = new MySubClass();
* console.log(foo instanceof MySuperClass); // true
Expand Down Expand Up @@ -539,7 +539,11 @@ this.createjs = this.createjs||{};
* only run once, associate arbitrary data with the listener, and remove the listener.
*
* This method works by creating an anonymous wrapper function and subscribing it with addEventListener.
* The created anonymous function is returned for use with .removeEventListener (or .off).
* The wrapper function is returned for use with `removeEventListener` (or `off`).
*
* <b>IMPORTANT:</b> To remove a listener added with `on`, you must pass in the returned wrapper function as the listener, or use
* {{#crossLink "Event/remove"}}{{/crossLink}}. Likewise, each time you call `on` a NEW wrapper function is subscribed, so multiple calls
* to `on` with the same params will create multiple listeners.
*
* <h4>Example</h4>
*
Expand Down Expand Up @@ -609,6 +613,9 @@ this.createjs = this.createjs||{};
/**
* A shortcut to the removeEventListener method, with the same parameters and return value. This is a companion to the
* .on method.
*
* <b>IMPORTANT:</b> To remove a listener added with `on`, you must pass in the returned wrapper function as the listener. See
* {{#crossLink "EventDispatcher/on"}}{{/crossLink}} for an example.
*
* @method off
* @param {String} type The string type of the event.
Expand Down Expand Up @@ -1068,7 +1075,7 @@ this.createjs = this.createjs||{};
};

/**
* Use the {{#crossLink "Ticker/framerate:property"}}{{/crossLink}} property instead.
* Use the {{#crossLink "Ticker/interval:property"}}{{/crossLink}} property instead.
* @method getInterval
* @static
* @return {Number}
Expand All @@ -1090,7 +1097,7 @@ this.createjs = this.createjs||{};
};

/**
* Use the {{#crossLink "Ticker/interval:property"}}{{/crossLink}} property instead.
* Use the {{#crossLink "Ticker/framerate:property"}}{{/crossLink}} property instead.
* @method getFPS
* @static
* @return {Number}
Expand Down Expand Up @@ -1242,7 +1249,8 @@ this.createjs = this.createjs||{};
};

/**
* Similar to getTime(), but returns the time on the most recent tick event object.
* Similar to the {{#crossLink "Ticker/getTime"}}{{/crossLink}} method, but returns the time on the most recent {{#crossLink "Ticker/tick:event"}}{{/crossLink}}
* event object.
* @method getEventTime
* @static
* @param runTime {Boolean} [runTime=false] If true, the runTime property will be returned instead of time.
Expand Down Expand Up @@ -2701,7 +2709,6 @@ this.createjs = this.createjs||{};
* @protected
**/
this._enabled = false;


// setup:
target.mouseChildren = false; // prevents issues when children are removed from the display list when state changes.
Expand Down Expand Up @@ -2748,12 +2755,14 @@ this.createjs = this.createjs||{};
o.addEventListener("rollout", this);
o.addEventListener("mousedown", this);
o.addEventListener("pressup", this);
if (o._reset) { o.__reset = o._reset; o._reset = this._reset;}
} else {
o.cursor = null;
o.removeEventListener("rollover", this);
o.removeEventListener("rollout", this);
o.removeEventListener("mousedown", this);
o.removeEventListener("pressup", this);
if (o.__reset) { o._reset = o.__reset; delete(o.__reset); }
}
};
/**
Expand Down Expand Up @@ -2816,6 +2825,18 @@ this.createjs = this.createjs||{};
t.gotoAndStop&&t.gotoAndStop(label);
}
};

/**
* Injected into target. Preserves the paused state through a reset.
* @method _reset
* @protected
**/
p._reset = function() {
// TODO: explore better ways to handle this issue. This is hacky & disrupts object signatures.
var p = this.paused;
this.__reset();
this.paused = p;
};


createjs.ButtonHelper = ButtonHelper;
Expand Down Expand Up @@ -3341,7 +3362,7 @@ this.createjs = this.createjs||{};
img.src = src;
}
a.push(img);
if (!img.getContext && !img.complete) {
if (!img.getContext && !img.naturalWidth) {
this._loadCount++;
this.complete = false;
(function(o) { img.onload = function() { o._handleImageLoad(); } })(this);
Expand Down Expand Up @@ -5410,7 +5431,7 @@ this.createjs = this.createjs||{};
* @return {Fill} Returns this Fill object for chaining or assignment.
*/
p.bitmap = function(image, repetition) {
if (image.complete || image.getContext || image.readyState >= 2) {
if (image.naturalWidth || image.getContext || image.readyState >= 2) {
var o = this.style = Graphics._ctx.createPattern(image, repetition || "");
o.props = {image: image, repetition: repetition, type: "bitmap"};
}
Expand Down Expand Up @@ -7331,7 +7352,7 @@ this.createjs = this.createjs||{};
*
* <h4>Example</h4>
*
* container.removeAlLChildren();
* container.removeAllChildren();
*
* @method removeAllChildren
**/
Expand Down Expand Up @@ -8725,8 +8746,8 @@ this.createjs = this.createjs||{};
p.getBounds = function() {
var rect = this.DisplayObject_getBounds();
if (rect) { return rect; }
var o = this.sourceRect || this.image;
var hasContent = (this.image && (this.image.complete || this.image.getContext || this.image.readyState >= 2));
var image = this.image, o = this.sourceRect || image;
var hasContent = (image && (image.naturalWidth || image.getContext || image.readyState >= 2));
return hasContent ? this._rectangle.setValues(0, 0, o.width, o.height) : null;
};

Expand Down Expand Up @@ -12579,6 +12600,6 @@ this.createjs = this.createjs || {};
* @type String
* @static
**/
s.buildDate = /*=date*/"Wed, 18 Mar 2015 15:39:42 GMT"; // injected by build process
s.buildDate = /*=date*/"Wed, 27 May 2015 18:12:21 GMT"; // injected by build process

})();
8 changes: 4 additions & 4 deletions lib/easeljs-NEXT.min.js

Large diffs are not rendered by default.

80 changes: 68 additions & 12 deletions lib/movieclip-NEXT.combined.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,30 @@
/*!
* EaselJS
* Visit http://createjs.com/ for documentation, updates and examples.
*
* Copyright (c) 2010 gskinner.com, inc.
*
* Permission is hereby granted, free of charge, to any person
* obtaining a copy of this software and associated documentation
* files (the "Software"), to deal in the Software without
* restriction, including without limitation the rights to use,
* copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following
* conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
* OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
* OTHER DEALINGS IN THE SOFTWARE.
*/


//##############################################################################
Expand Down Expand Up @@ -178,7 +205,7 @@ this.createjs = this.createjs||{};
* passed into {{#crossLink "Stage/update"}}{{/crossLink}}.
* @property framerate
* @type {Number}
* @default 0
* @default null
**/
this.framerate = null;

Expand Down Expand Up @@ -295,6 +322,16 @@ this.createjs = this.createjs||{};
this._updateTimeline();
return this.timeline.getCurrentLabel();
};

/**
* Use the {{#crossLink "MovieClip/duration:property"}}{{/crossLink}} property instead.
* @method getDuration
* @return {Number}
* @protected
**/
p.getDuration = function() {
return this.timeline.duration;
};

/**
* Returns an array of objects with label and position (aka frame) properties, sorted by position.
Expand All @@ -303,18 +340,35 @@ this.createjs = this.createjs||{};
* @type {Array}
* @readonly
**/

/**
* Returns the name of the label on or immediately before the current frame. See TweenJS: Timeline.getCurrentLabel()
* for more information.
* @property currentLabel
* @type {String}
* @readonly
**/

/**
* Returns the duration of this MovieClip in seconds or ticks. Identical to {{#crossLink "MovieClip/duration:property"}}{{/crossLink}}
* and provided for Flash API compatibility.
* @property totalFrames
* @type {Number}
* @readonly
**/

/**
* Returns the duration of this MovieClip in seconds or ticks.
* @property duration
* @type {Number}
* @readonly
**/
try {
Object.defineProperties(p, {
labels: { get: p.getLabels },
currentLabel: { get: p.getCurrentLabel }
currentLabel: { get: p.getCurrentLabel },
totalFrames: { get: p.getDuration },
duration: { get: p.getDuration }
});
} catch (e) {}

Expand Down Expand Up @@ -472,8 +526,8 @@ this.createjs = this.createjs||{};
**/
p._reset = function() {
this._prevPos = -1;
this._t = 0;
this.currentFrame = 0;
this._t = this.currentFrame = 0;
this.paused = false;
};

/**
Expand All @@ -484,13 +538,15 @@ this.createjs = this.createjs||{};
var tl = this.timeline;
var synched = this.mode != MovieClip.INDEPENDENT;
tl.loop = (this.loop==null) ? true : this.loop;


var pos = synched ? this.startPosition + (this.mode==MovieClip.SINGLE_FRAME?0:this._synchOffset) : (this._prevPos < 0 ? 0 : this._prevPosition);
var mode = synched || !this.actionsEnabled ? createjs.Tween.NONE : null;

// pre-assign currentFrame so it is available to frame scripts:
this.currentFrame = tl._calcPosition(pos);

// update timeline position, ignoring actions if this is a graphic.
if (synched) {
tl.setPosition(this.startPosition + (this.mode==MovieClip.SINGLE_FRAME?0:this._synchOffset), createjs.Tween.NONE);
} else {
tl.setPosition(this._prevPos < 0 ? 0 : this._prevPosition, this.actionsEnabled ? null : createjs.Tween.NONE);
}
tl.setPosition(pos, mode);

this._prevPosition = tl._prevPosition;
if (this._prevPos == tl._prevPos) { return; }
Expand Down Expand Up @@ -677,6 +733,6 @@ this.createjs = this.createjs || {};
* @type String
* @static
**/
s.buildDate = /*=date*/"Wed, 24 Dec 2014 17:51:55 GMT"; // injected by build process
s.buildDate = /*=date*/"Wed, 27 May 2015 18:12:21 GMT"; // injected by build process

})();
4 changes: 2 additions & 2 deletions lib/movieclip-NEXT.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion lib/webgl-NEXT.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit d59298c

Please sign in to comment.