WIP
This commit is contained in:
16
src/board/layers/drawText.ts
Normal file
16
src/board/layers/drawText.ts
Normal file
@@ -0,0 +1,16 @@
|
||||
const drawText = (
|
||||
ctx: CanvasRenderingContext2D,
|
||||
text: string,
|
||||
fontSize: number,
|
||||
fontWeight: number,
|
||||
x: number,
|
||||
y: number,
|
||||
align: CanvasTextAlign
|
||||
) => {
|
||||
ctx.font = `${fontWeight} ${fontSize}px Ubuntu`;
|
||||
ctx.textAlign = align;
|
||||
ctx.textBaseline = "middle";
|
||||
ctx.fillText(text, x, y);
|
||||
};
|
||||
|
||||
export default drawText;
|
||||
Reference in New Issue
Block a user