Spaces:
Runtime error
Runtime error
Update lineupRenderer.js
Browse files- lineupRenderer.js +3 -3
lineupRenderer.js
CHANGED
|
@@ -151,12 +151,12 @@ function drawPitch(ctx, W, H) {
|
|
| 151 |
/**
|
| 152 |
* Render the lineup as a PNG image buffer
|
| 153 |
* @param {Map} lineup - Map of posKey -> [userId, ...]
|
| 154 |
-
* @param {string}
|
| 155 |
* @param {Array} formation - Array of [posKey, posLabel]
|
| 156 |
* @param {object} client - Discord client for fetching user data
|
| 157 |
* @returns {Promise<Buffer>} PNG image buffer
|
| 158 |
*/
|
| 159 |
-
async function renderLineupImage(lineup,
|
| 160 |
const PITCH_W = 900;
|
| 161 |
const SIDEBAR_W = 280;
|
| 162 |
const W = PITCH_W + SIDEBAR_W;
|
|
@@ -223,7 +223,7 @@ async function renderLineupImage(lineup, formKey, formation, client) {
|
|
| 223 |
ctx.fillStyle = '#ffffff';
|
| 224 |
ctx.font = 'bold 16px Arial, sans-serif';
|
| 225 |
ctx.textAlign = 'center';
|
| 226 |
-
ctx.fillText(`LINEUP — ${
|
| 227 |
ctx.restore();
|
| 228 |
|
| 229 |
// Extract subs and draw them
|
|
|
|
| 151 |
/**
|
| 152 |
* Render the lineup as a PNG image buffer
|
| 153 |
* @param {Map} lineup - Map of posKey -> [userId, ...]
|
| 154 |
+
* @param {string} title - Title to display on the image
|
| 155 |
* @param {Array} formation - Array of [posKey, posLabel]
|
| 156 |
* @param {object} client - Discord client for fetching user data
|
| 157 |
* @returns {Promise<Buffer>} PNG image buffer
|
| 158 |
*/
|
| 159 |
+
async function renderLineupImage(lineup, title, formation, client) {
|
| 160 |
const PITCH_W = 900;
|
| 161 |
const SIDEBAR_W = 280;
|
| 162 |
const W = PITCH_W + SIDEBAR_W;
|
|
|
|
| 223 |
ctx.fillStyle = '#ffffff';
|
| 224 |
ctx.font = 'bold 16px Arial, sans-serif';
|
| 225 |
ctx.textAlign = 'center';
|
| 226 |
+
ctx.fillText(`LINEUP — ${title.toUpperCase()}`, PITCH_W / 2, 24);
|
| 227 |
ctx.restore();
|
| 228 |
|
| 229 |
// Extract subs and draw them
|