3 BouncingCssImage = Utilities.createSubclass(BouncingParticle,
6 BouncingParticle.call(this, stage);
8 this.element = document.createElement("img");
9 this.element.style.width = this.size.x + "px";
10 this.element.style.height = this.size.y + "px";
11 this.element.setAttribute("src", stage.imageSrc);
13 stage.element.appendChild(this.element);
19 this.element.style.transform = "translate(" + this.position.x + "px," + this.position.y + "px) " + this.rotater.rotateZ();
22 animate: function(timeDelta)
24 BouncingParticle.prototype.animate.call(this, timeDelta);
29 BouncingCssImagesStage = Utilities.createSubclass(BouncingParticlesStage,
32 BouncingParticlesStage.call(this);
35 initialize: function(benchmark, options)
37 BouncingParticlesStage.prototype.initialize.call(this, benchmark, options);
38 this.imageSrc = options["imageSrc"] || "../resources/yin-yang.svg";
41 createParticle: function()
43 return new BouncingCssImage(this);
46 particleWillBeRemoved: function(particle)
48 particle.element.remove();
52 BouncingCssImagesBenchmark = Utilities.createSubclass(Benchmark,
55 Benchmark.call(this, new BouncingCssImagesStage(), options);
59 window.benchmarkClass = BouncingCssImagesBenchmark;