2020-01-17 21:11:15 +01:00
|
|
|
/**
|
|
|
|
* Text class
|
|
|
|
*/
|
2019-08-20 17:59:26 +02:00
|
|
|
class Text {
|
2020-01-17 21:11:15 +01:00
|
|
|
/**
|
|
|
|
* Prints styled text on canvas
|
|
|
|
* @param {String} text Text to print
|
|
|
|
* @param {String} style Styles to apply to text
|
|
|
|
*/
|
2019-08-20 17:59:26 +02:00
|
|
|
constructor(text = "", style = {}) {
|
2020-01-17 21:11:15 +01:00
|
|
|
this.pos = { x: 0, y: 0 };
|
2019-08-20 17:59:26 +02:00
|
|
|
this.text = text;
|
|
|
|
this.style = style;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
export default Text;
|