Answer the question
In order to leave comments, you need to log in
How to make canvas loop?
You need to complete the following point:
the movement of the logo should be cyclic - if the logo goes beyond the canvas, then the disappeared part should appear on the opposite side.
how to do it?
Logo and movement code
Video as it should be
Answer the question
In order to leave comments, you need to log in
Draw a logo inside the pattern and set the transformation for the pattern for animation.
https://developer.mozilla.org/en-US/docs/Web/API/C...
How exactly is the logo drawn?
You can stupidly do this:
here I see 2 options
1) you track when the coordinates go beyond the visible field, you have it 0 and 400, and redraw on several objects, since you no longer have 3 sticks, but 2 on one side and 1-2 on the other
2) but it's easier to multiply your shape in X and Y at a distance of 400 pixels from the edges. then when moving beyond the borders on the other side, another, exactly the same figure will appear, which will give the desired effect.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question