Witam
W osobnej funkcji rysuję sobie gradient, a w jeszcze innej kółko. Gradient rysuje się bezproblemowo, lecz problem tkwi w tym, że kółko pojawia się i po chwili znika. Co zrobić?
function randomPoint() //kolko { var ctx = context; ctx.beginPath(); ctx.arc(a,b,15,0,2*Math.PI); ctx.stroke(); ctx.fillRect(10,10,1,1); ctx.fill(); } function rysuj() { context.clearRect(0, 0, plotno.width, plotno.height); context.rect(0, 0, plotno.width, plotno.height); var grd = context.createLinearGradient(0, 0, plotno.width, plotno.height); grd.addColorStop(0, '#8ED6FF'); grd.addColorStop(1, '#004CB3'); context.fillStyle = grd; context.fill(); var postac = document.getElementById('postac'); context.drawImage(postac,x,y,32,32); }
,
setInterval(function() { rysuj(); randomPoint(); }, 1000/30);
context.clearRect(0, 0, plotno.width, plotno.height);