UNPKG

@talabes/football-lineup-generator

Version:

A TypeScript library for generating visual football lineup diagrams from team positioning data. Fork of ncamaa/football-lineup-generator with bug fixes and improvements.

10 lines (9 loc) 403 B
export function drawTeamLabel(ctx, teamName, isHomeTeam, width, homeTeamColor, awayTeamColor, fontSize, offsetX = 0) { const x = (isHomeTeam ? 70 : width - 70) + offsetX; const y = 30; ctx.fillStyle = isHomeTeam ? homeTeamColor : awayTeamColor; ctx.font = `bold ${fontSize + 4}px Arial`; ctx.textAlign = 'center'; ctx.textBaseline = 'middle'; ctx.fillText(teamName, x, y); }