linter fixes

This commit is contained in:
jonny 2021-07-02 19:05:03 +02:00
parent 310e131a6e
commit 9bcdc9ba33
4 changed files with 108 additions and 108 deletions

View file

@ -1,10 +1,10 @@
import type { ITiledMapObject } from "../Map/ITiledMap";
import type { GameScene } from "../Game/GameScene";
import type { ITiledMapObject } from '../Map/ITiledMap';
import type { GameScene } from '../Game/GameScene';
export class TextUtils {
public static createTextFromITiledMapObject(scene: GameScene, object: ITiledMapObject): void {
if (object.text === undefined) {
throw new Error("This object has not textual representation.");
throw new Error('This object has not textual representation.');
}
const options: {
fontStyle?: string;
@ -18,18 +18,18 @@ export class TextUtils {
};
} = {};
if (object.text.italic) {
options.fontStyle = "italic";
options.fontStyle = 'italic';
}
// Note: there is no support for "strikeout" and "underline"
let fontSize: number = 16;
if (object.text.pixelsize) {
fontSize = object.text.pixelsize;
}
options.fontSize = fontSize + "px";
options.fontSize = fontSize + 'px';
if (object.text.fontfamily) {
options.fontFamily = '"' + object.text.fontfamily + '"';
}
let color = "#000000";
let color = '#000000';
if (object.text.color !== undefined) {
color = object.text.color;
}