From 2f8b8c87fb2062313afea7b625ccb20d1bea95b9 Mon Sep 17 00:00:00 2001 From: Maksymilian Jopek Date: Tue, 24 May 2022 18:25:43 +0200 Subject: Initial commit --- src/drawables/Selector.ts | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 src/drawables/Selector.ts (limited to 'src/drawables/Selector.ts') diff --git a/src/drawables/Selector.ts b/src/drawables/Selector.ts new file mode 100644 index 0000000..b72d839 --- /dev/null +++ b/src/drawables/Selector.ts @@ -0,0 +1,15 @@ +import { canvas, ctx } from "../consts"; +import Drawable from "../Drawable"; +import { IMGS } from "../Images"; + +export class Selector extends Drawable { + sprite = IMGS.selector + width = canvas.width + height = 24 + draw() { + if (this.sprite.src == null) this.sprite = IMGS.selector; + ctx.drawImage(this.sprite, this.x, this.y) + } +} + + -- cgit v1.3.1