Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

How to make move able triangle in canvas js

        function drawTrianlge(e) {     // add eventlistener!!!
            var bx = fe.offsetX;
            var by = fe.offsetY;
            var x = e.offsetX;
            var y = e.offsetY;
            context.beginPath();
            context.moveTo(bx, y);       
            context.lineTo(x, y);
            context.lineTo(x, by);
            context.closePath();
            context.stroke();            
        }
 
PREVIOUS NEXT
Tagged: #How #move #triangle #canvas #js
ADD COMMENT
Topic
Name
6+1 =