feat(home): implement background, clock and calendar
This commit is contained in:
@@ -1,9 +1,23 @@
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user