X-Git-Url: https://git.yukkurigames.com/?p=pwl6.git;a=blobdiff_plain;f=src%2Fyuu%2Fce.js;h=d604e7065fb4ae3fab29be83565d036a4e889bdd;hp=bb5c6e5935897b22b13d73cbcb463fd57247bb64;hb=f96f0ecc5cd905dba4d20f3a06d154bf2683bff3;hpb=d2962105772fbdc548118bd65cd5bb4934e66085 diff --git a/src/yuu/ce.js b/src/yuu/ce.js index bb5c6e5..d604e70 100644 --- a/src/yuu/ce.js +++ b/src/yuu/ce.js @@ -1,7 +1,7 @@ /* Copyright 2014 Yukkuri Games Licensed under the terms of the GNU GPL v2 or later - @license http://www.gnu.org/licenses/gpl-2.0.html - @source: http://yukkurigames.com/yuu/ + @license https://www.gnu.org/licenses/gpl-2.0.html + @source: https://yukkurigames.com/yuu/ */ (function (yuu) { @@ -147,7 +147,9 @@ }); - yuu.Animation = yT(yuu.C, { + var animationOps = []; + + var Animation = yuu.Animation = yT(yuu.C, { constructor: function (timeline, params, completionHandler, delay) { this.timeline = yf.mapValues(yf.arrayify, timeline); this.params = params; @@ -262,6 +264,10 @@ this.tweenAll(instr.tweenAll, instr); if (instr.event) this.event(instr.event); + animationOps.forEach(function (f) { + if (instr[f.name]) + f.call(this, instr[f.name], instr); + }, this); }, tick: function () { @@ -293,6 +299,10 @@ TAPS: ["tick", "tock"] }); + Animation.registerOperation = function (f) { + animationOps.push(f); + }; + yuu.Tween = yT({ /** Tween object properties over time