This is the part of the code that will animated the hour-pointer, for the minutes and seconds is basically the same understand the seconds is more longer because is making more stilized the seconds pointer, so for the hours, save is because when we being animating the hours we gonna make deep changesin the settings and we gonna want to make the minutes and seconds the state previous the change, so we save to restore to this situation when animating the others pointers, why this code is animated 1st because in the end we gonna ask the window.requestAnimatedFrame(clock) but also because we are saying to print in the screen the hours but the hours are changing all the time of course is more easy to see in the seconds pointer, but we ask Animated the seconds or hours and this is changing all the time, without the method request... everytime we refresh the page will give the hours, with the method the clock moves, the ctx.rotate... - is the reality that change so what make it be animated.
ctx.lineWidth... - stillize the pointer to be of that thikness
ctx.beginPath(),ctx.move(...), ctx.lineTo(...);ctx.stroke() - make the hour pointer without any of that lines we don't gonna see the pointer.
And how I said we ask a reality that is changing, the time so and the method - requestAnimated... for this we see the animation.
Rute Bezera de Menezes Gondim
No comments:
Post a Comment