rt-sim-training-client/src/jmap/shape/element/ETextName.js

44 lines
807 B
JavaScript
Raw Normal View History

2019-07-16 16:03:56 +08:00
import Group from 'zrender/src/container/Group';
import Text from 'zrender/src/graphic/Text';
/** 名称元素*/
export default class ETextName extends Group {
constructor(model) {
super();
this.model = model;
this.zlevel = model.zlevel;
this.z = model.z;
this._create();
}
_create() {
this.TextName = new Text({
_subType: this.model._subType,
zlevel: this.zlevel,
z: this.z,
style: {
x: this.model.x,
y: this.model.y,
text: this.model.text,
textFont: this.model.textFont,
textFill: this.model.textFill,
textAlign: this.model.textAlign,
textPosition: this.model.textPosition
}
});
this.add(this.TextName);
}
setStyle(model) {
this.TextName.setStyle(model);
}
hide() {
this.TextName.hide();
}
show() {
this.TextName.show();
}
}