@awayjs/stage
Version:
Stage for AwayJS
75 lines (73 loc) • 2.27 kB
JavaScript
import { __extends } from "tslib";
import { Image2D } from './Image2D';
/**
*/
var ExternalImage2D = /** @class */ (function (_super) {
__extends(ExternalImage2D, _super);
/**
*
*/
function ExternalImage2D(urlRequest) {
var _this = _super.call(this, 8, 8, true) || this;
_this._urlRequest = urlRequest;
return _this;
}
Object.defineProperty(ExternalImage2D.prototype, "assetType", {
/**
*
* @returns {string}
*/
get: function () {
return ExternalImage2D.assetType;
},
enumerable: false,
configurable: true
});
Object.defineProperty(ExternalImage2D.prototype, "urlRequest", {
get: function () {
return this._urlRequest;
},
set: function (value) {
this._urlRequest = value;
},
enumerable: false,
configurable: true
});
/**
* Returns a new ExternalImage2D object that is a clone of the original instance
* with an exact copy of the contained bitmap.
*
* @return A new ExternalImage2D object that is identical to the original.
*/
ExternalImage2D.prototype.clone = function () {
var t = new ExternalImage2D(this._urlRequest);
return t;
};
ExternalImage2D.assetType = '[image ExternalImage2D]';
return ExternalImage2D;
}(Image2D));
export { ExternalImage2D };
import { _Stage_Image2D } from './Image2D';
/**
*
* @class away.pool.ImageObjectBase
*/
var _Stage_ExternalImage2D = /** @class */ (function (_super) {
__extends(_Stage_ExternalImage2D, _super);
function _Stage_ExternalImage2D() {
return _super !== null && _super.apply(this, arguments) || this;
}
_Stage_ExternalImage2D.prototype.getTexture = function () {
_super.prototype.getTexture.call(this);
if (this._invalid) {
this._invalid = false;
this._texture.uploadFromURL(this.image.urlRequest, 0);
this._invalidMipmaps = true;
}
return this._texture;
};
return _Stage_ExternalImage2D;
}(_Stage_Image2D));
export { _Stage_ExternalImage2D };
// MOVED TO LIB INDEX
// Stage.registerAbstraction(_Stage_ExternalImage2D, ExternalImage2D);