MCPcopy
hub / github.com/shzlw/zeu / drawFrame

Method drawFrame

src/base-component.js:75–106  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

73 }
74
75 drawFrame() {
76 // Check movement
77 if (this._eventQueue.length > 0) {
78 const event = this._eventQueue[0];
79
80 if (event.type === 'move') {
81 if (this._x === event.destX && this._y === event.destY) {
82 this._eventQueue.shift();
83 } else {
84 this._x = Utility.getNextPos(this._x, event.destX, event.speedX);
85 this._y = Utility.getNextPos(this._y, event.destY, event.speedY);
86 }
87 }
88 }
89
90 // Check display or not.
91 if (!this.isDisplay()) {
92 return;
93 }
94
95 this.clear();
96
97 this.save();
98 this.drawObject();
99 this._ctx.restore();
100
101 if (this.isAlert()) {
102 this.save();
103 this._alert.lastCall = this.nextAlert(this.alertFunc, this._alert.lastCall, this._alert.interval);
104 this._ctx.restore();
105 }
106 }
107
108 drawObject() {}
109

Callers

nothing calls this directly

Calls 7

isDisplayMethod · 0.95
clearMethod · 0.95
saveMethod · 0.95
drawObjectMethod · 0.95
isAlertMethod · 0.95
nextAlertMethod · 0.95
getNextPosMethod · 0.80

Tested by

no test coverage detected