Advertisement
jargon

function drawText ( canvas, index, x, y, text )

Nov 9th, 2024 (edited)
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function drawText ( canvas, index, x, y, text ) {
  2.    
  3.     let context = canvas.getContext (`2d`);
  4.    
  5.     context.fillStyle = `argb( 255, 255, 255, 1.0 )`;
  6.    
  7.     context.font = `8px "Px437 IBM VGA8"`; // Substitute with "IBM VGA 8x16" or similar if available
  8.  
  9.     context.fillText (
  10.         text,
  11.         x * Sprites[index].xspan,
  12.         y * Sprites[index].yspan
  13.     );
  14.    
  15.     console.log(`Draw Text: "${text}" @ ( ${x}, ${y} )`);
  16. }
  17.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement