ujs/src/js/objects.js

27 lines
535 B
JavaScript

class Object {
constructor(x, y, w, h) {
this.x = x;
this.y = y;
this.width = w;
this.height = h;
this.ticker = null;
}
}
export class Rect extends Object {
constructor(x, y, w, h, fillColor = 'white') {
super(x, y, w, h);
this.fillColor = fillColor;
}
}
export class StrokeRect extends Rect {
constructor(x, y, w, h, fillColor = 'white', strokeColor = 'black', strokeWidth = 1) {
super(x, y, w, h, fillColor);
this.strokeWidth = strokeWidth;
this.strokeColor = strokeColor;
}
}