Canvas API
Në shqip përdoret i njëjti emër.
ShpjegimiSQ
Elementi <canvas> është një telajo ku vizaton me JavaScript: figura, imazhe, grafikë dhe lojëra 2D. getContext("2d") jep metoda si fillRect() dhe arc().
EnglishEN
The <canvas> element is a board you draw on with JavaScript: shapes, images, charts and 2D games. getContext("2d") gives methods like fillRect() and arc().
Si ta mendosh
Si një tabelë e bardhë ku vizaton me kod.
Lexoje në anglisht
Like a whiteboard you draw on with code.
Shembull kodijavascript
const ctx = document.querySelector("canvas").getContext("2d");
ctx.fillStyle = "tomato";
ctx.fillRect(10, 10, 100, 50);