0
Why is everyone freaking out over JavaScript?
Mmm what does the "2d" mean whilst drawing a rectangle?
3 Answers
+ 3
While drawing a rectangle in (or even circles, text, lines, etc) you ought to choose what you want to do with the canvas (area where you will have to draw the shape). By defining the drawing context as '2d', you are simply telling the js that you want to draw a 2-dimensional shape on the canvas surface. mind you, the other alternative would be '3d' meaning 3-dimensional drawing on the canvas surface.
0
Thank you Dennis, that's what i thought. now, do you know how to write the code for, let's say a 3d box?
0
@Brian Montellano There is a 3D context for canvas but it is not defined as ("3d") - it is WebGL and is defined as ("webgl").