+ 1

getcontext("2d")

What does it mean? (especially 2d)

11th Dec 2017, 12:05 PM
ANKIT
ANKIT - avatar
3 Answers
+ 5
It means you are getting a 2-dimensional context of the canvas so everything you draw is 2d! getContext("webGl") youre getting a 3d context if the canvas so your drawings will be 3-dimensional
11th Dec 2017, 3:21 PM
᠌᠌Code X
᠌᠌Code X - avatar
+ 4
it's used to declare the context for use in drawing the canvas object
11th Dec 2017, 12:08 PM
Nomeh Uchenna Gabriel
Nomeh Uchenna Gabriel - avatar
+ 2
It means our context is 2-dimensional or planar context
11th Dec 2017, 12:09 PM
#RahulVerma
#RahulVerma - avatar