Commit 243f691e authored by rockyl's avatar rockyl

修复

parent f605b35a
...@@ -25,6 +25,11 @@ export class BitmapText extends Container implements IUIComponent { ...@@ -25,6 +25,11 @@ export class BitmapText extends Container implements IUIComponent {
@dirtyFieldTrigger @dirtyFieldTrigger
public letterSpacing: number = 0; public letterSpacing: number = 0;
constructor() {
super();
this._instanceType = "BitmapText";
}
onModify(value, key) { onModify(value, key) {
switch (key) { switch (key) {
case 'text': case 'text':
......
...@@ -19,6 +19,7 @@ export class HtmlView extends FloatDisplay implements IUIComponent{ ...@@ -19,6 +19,7 @@ export class HtmlView extends FloatDisplay implements IUIComponent{
constructor() { constructor() {
super(); super();
this._instanceType = "HtmlView";
this.afterConstructor(); this.afterConstructor();
} }
......
...@@ -34,6 +34,11 @@ export class Image extends Sprite implements IUIComponent { ...@@ -34,6 +34,11 @@ export class Image extends Sprite implements IUIComponent {
} }
} }
constructor() {
super();
this._instanceType = "Image";
}
private updateSource() { private updateSource() {
let url = this._source; let url = this._source;
......
...@@ -18,6 +18,11 @@ export class Label extends TextField implements IUIComponent { ...@@ -18,6 +18,11 @@ export class Label extends TextField implements IUIComponent {
private _registeredEvents = []; private _registeredEvents = [];
private _htmlText; private _htmlText;
constructor() {
super();
this._instanceType = "Label";
}
/** /**
* 重载文本设置 * 重载文本设置
* @param value * @param value
......
...@@ -7,4 +7,8 @@ import {IUIComponent} from "./IUIComponent"; ...@@ -7,4 +7,8 @@ import {IUIComponent} from "./IUIComponent";
export class Node extends Container implements IUIComponent{ export class Node extends Container implements IUIComponent{
isUI = true; isUI = true;
constructor() {
super();
this._instanceType = "Node";
}
} }
\ No newline at end of file
...@@ -14,6 +14,11 @@ export class ScrollListItem extends ScrollListItemBase implements IUIComponent { ...@@ -14,6 +14,11 @@ export class ScrollListItem extends ScrollListItemBase implements IUIComponent {
view: Container; view: Container;
constructor() {
super();
this._instanceType = "ScrollListItem";
}
setView(view) { setView(view) {
this.addChild(view); this.addChild(view);
this.view = view; this.view = view;
...@@ -32,6 +37,7 @@ export class ScrollList extends ScrollListBase { ...@@ -32,6 +37,7 @@ export class ScrollList extends ScrollListBase {
constructor() { constructor() {
super(); super();
this._instanceType = "ScrollList";
this.itemClass = ScrollListItem; this.itemClass = ScrollListItem;
......
...@@ -25,6 +25,7 @@ export class ScrollView extends ScrollViewBase implements IUIComponent { ...@@ -25,6 +25,7 @@ export class ScrollView extends ScrollViewBase implements IUIComponent {
constructor() { constructor() {
super(); super();
this._instanceType = "ScrollView";
for(let item of proxyMethods){ for(let item of proxyMethods){
this[item] = this.viewPort[item].bind(this.viewPort); this[item] = this.viewPort[item].bind(this.viewPort);
......
...@@ -51,6 +51,7 @@ export class TextInput extends Label implements IUIComponent { ...@@ -51,6 +51,7 @@ export class TextInput extends Label implements IUIComponent {
constructor() { constructor() {
super(); super();
this._instanceType = "TextInput";
this.setup(); this.setup();
this.addEventListener(MouseEvent.CLICK, this.onClickStatic, this); this.addEventListener(MouseEvent.CLICK, this.onClickStatic, this);
......
...@@ -25,6 +25,7 @@ class ShapeBase extends Graphics implements IUIComponent { ...@@ -25,6 +25,7 @@ class ShapeBase extends Graphics implements IUIComponent {
constructor() { constructor() {
super(); super();
this._instanceType = "ShapeBase";
this.addEventListener(Event.ENTER_FRAME, this.onEnterFrame, this); this.addEventListener(Event.ENTER_FRAME, this.onEnterFrame, this);
this.addEventListener(Event.RESIZE, this.onResize, this); this.addEventListener(Event.RESIZE, this.onResize, this);
...@@ -64,6 +65,11 @@ export class Rect extends ShapeBase { ...@@ -64,6 +65,11 @@ export class Rect extends ShapeBase {
@dirtyFieldDetector @dirtyFieldDetector
borderRadius: number = 0; borderRadius: number = 0;
constructor() {
super();
this._instanceType = "Rect";
}
protected redraw() { protected redraw() {
const {width, height, borderRadius,} = this; const {width, height, borderRadius,} = this;
if(width == 0 || height == 0){ if(width == 0 || height == 0){
...@@ -81,6 +87,11 @@ export class Rect extends ShapeBase { ...@@ -81,6 +87,11 @@ export class Rect extends ShapeBase {
* 圆形 * 圆形
*/ */
export class Circle extends ShapeBase { export class Circle extends ShapeBase {
constructor() {
super();
this._instanceType = "Circle";
}
protected redraw() { protected redraw() {
super.redraw(); super.redraw();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment