Last active
December 17, 2015 23:08
-
-
Save dbasilioesp/5686693 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var P0x = 230; | |
var P0y = 50; | |
var P1x = 350; | |
var P1y = 150; | |
var px = P0x + t*(P1x - P0x) | |
var py = P0y + t*(P1y - P0y) | |
ctx.beginPath(); // inicia o desenho | |
ctx.rect(px,py , 20,20); // 20 20 é o tamanho do quadrado | |
ctx.fillStyle = "#FFF"; // cor | |
ctx.closePath(); // finaliza o desenho | |
ctx.fill(); // preenche com a cor | |
if (t < 1) | |
t += 0.01; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment