@awayjs/scene
Version:
AwayJS scene classes
26 lines (25 loc) • 1.08 kB
JavaScript
import { __extends } from "tslib";
import { Sprite } from './Sprite';
import { TesselatedFontTable } from '../text/TesselatedFontTable';
import { HierarchicalProperty } from '@awayjs/view';
/**
* TextSprite is used for masked text.
* It is a child of the textfield that is used to render all visible (masked) graphics
*/
var TextSprite = /** @class */ (function (_super) {
__extends(TextSprite, _super);
function TextSprite() {
return _super !== null && _super.apply(this, arguments) || this;
}
TextSprite.prototype.getEntity = function () {
var tf = this.parentTextField;
//tf.reConstruct(true);
if (tf._textFormats[0] && !tf._textFormats[0].font_table.isAsset(TesselatedFontTable) && !tf._textFormats[0].bitmap) {
this.transform.colorTransform.color = (tf.textColor != null) ? tf.textColor : tf._textFormats[0].color;
this._invalidateHierarchicalProperty(HierarchicalProperty.COLOR_TRANSFORM);
}
return this._graphics;
};
return TextSprite;
}(Sprite));
export { TextSprite };