summaryrefslogtreecommitdiff
path: root/src/engine/components/Text.ts
blob: 94dc7a7b55b4f0acc9056196019c471e7d428bf3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
import { Component, ComponentNames } from ".";

export class Text extends Component {
  public text: string = "";
  public fillStyle: string;
  public font: string;
  public textAlign: CanvasTextAlign;

  constructor(
    text: string,
    fillStyle = "white",
    font = "25px scientifica",
    textAlign: CanvasTextAlign = "center",
  ) {
    super(ComponentNames.Text);

    this.text = text;
    this.fillStyle = fillStyle;
    this.font = font;
    this.textAlign = textAlign;
  }
}