/ Published in: JavaScript
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
jsUnity.attachAssertions(window); var MotionTweens = { suiteName: 'MotionTweens' }; var Tweens = Motion.getTweens(); for (var i in Tweens) { (function () { MotionTweens['test' + i.replace(/^[a-z]{1}/, function(c){return c.toUpperCase()})] = function() { var duration = 2000, frames = Math.ceil((duration/1000)*35); var from = 0, to = 1000, current = 1, result = 0; while (current++ < frames) { result = Tweens[i]((current/frames)*duration, from, to - from, duration); } assertEqual(1000, result); } })(); } jsUnity.log = function (s) {document.write("<div>" + s + "</div>"); } jsUnity.run(MotionTweens);
URL: http://www.gracecode.com/