Files
pihkaal-me/src/screens/home/top/index.ts

24 lines
682 B
TypeScript

import { ImageLoader } from "../../../utils/loadImages";
import { StatusBar } from "./statusBar";
import { Clock } from "./clock";
import { Calendar } from "./calendar";
export class HomeTopScreen {
private backgroundImage = new ImageLoader({
background: "/images/home/top-screen/background.webp",
});
private statusBar = new StatusBar();
private clock = new Clock();
private calendar = new Calendar();
render(ctx: CanvasRenderingContext2D): void {
if (!this.backgroundImage.isReady) return;
ctx.drawImage(this.backgroundImage.require("background"), 0, 0);
this.clock.render(ctx);
this.calendar.render(ctx);
this.statusBar.render(ctx);
}
}