what does mean "ctx" in drawing shapes | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 2

what does mean "ctx" in drawing shapes

the defined for ctx"

4th Apr 2017, 5:58 PM
trad
2 Answers
+ 13
context
4th Apr 2017, 5:59 PM
Tashi N
Tashi N - avatar
+ 10
canvas = document.getElementById("canvas"); ctx = canvas.getContext("2d"); So it usually is used to render the canvas in two dimensions, like in the example above or 3d using this code. ctx = canvas.getContext("webgl"); Hope this helps ! *_*
4th Apr 2017, 8:26 PM
Gami
Gami - avatar