blob: b978d409c5a158e58ff47b18ccb258e0c06d0800 [file] [log] [blame]
function DImageElement(data, animationItem){
this.animationItem = animationItem;
this.assets = this.animationItem.getAssets();
this.path = this.animationItem.getPath();
this.parent.constructor.call(this,data, animationItem);
}
createElement(DBaseElement, DImageElement);
DImageElement.prototype.createElements = function(){
console.log('innnit',this);
var self = this;
var imageLoaded = function(){
self.animationItem.elementLoaded();
};
var img = new Image();
img.addEventListener('load', imageLoaded, false);
img.src = this.path+this.assets[this.data.assetId].path;
this.mainElement = img;
styleDiv(this.mainElement);
};