/
Graphics.ts
40 lines (24 loc) · 928 Bytes
/
Graphics.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
import { Bitmap } from "./Bitmap";
import { Font } from "./Font";
export const WHITE: string = "white";
export const BLACK: string = "black";
export const RED: string = "red";
export const GREEN: string = "green";
export const BLUE: string = "blue";
export interface Graphics {
copy(): Bitmap;
fillRect(x: number, y: number, width: number, height: number, col: string): void;
drawBitmap(x: number, y: number, bitmap: Bitmap): void;
drawScaledBitmap(x: number, y: number, width: number, height: number, bitmap: Bitmap): void;
setFont(font: Font): void;
setFontSize(size: number): void;
drawString(x: number, y: number, text: string, col: string): void;
translate(x: number, y: number): void;
scale(x: number, y: number): void;
push(): void;
pop(): void;
getWidth(): number;
getHeight(): number;
fitScreen(widthInVirtualPixels: number): void;
getStringWidth(text: string): number;
}