menu

Recent questions tagged canvas

1 vote
2 answers
image
Why doesn't the isPointInPath function work on the second canvas tile? isPointInPath() only triggers on the top tile when hovering the mouse, and all other tiles are highlighted. When you hover your cursor over the bottom half, nothing s ...
by dpablo_escobarr
asked Sep 24, 2021
1 vote
1 answer
image
How do I implement a diamond-shaped strategy map in Canvas, with the squares still selected when hovering? I don't understand how to make it so that after transforming a canvas context with the functions rotate(); translate(); the coordinates at each superimposed square by th ...
by dpablo_escobarr
asked Sep 24, 2021
1 vote
1 answer
What's the right way to clear the canvas animation and restart it at the click of a button? You need to trigger the canvas animation on the click of the button, and when you click again, the animation should reset and repeat (tugle effect). In the example I did ...
by Alice777
asked Sep 22, 2021
1 vote
1 answer
Collision check with objects(walls)? How do I check for a collision between a square and a wall? https://codepen.io/Mbreti/pen/YzqMoEP class WallObj { constructor(obj) {//x, y, w, h, bern ,thru) { ...
by Mbreti
asked Sep 21, 2021
1 vote
2 answers
How do I refactor my code? https://codepen.io/Mbreti/pen/YzqMoEP From this piece of code const mouseEvent = () => { canvas.onmousedown = (e) => { const start = { x: e.offsetX, ...
by Mbreti
asked Sep 19, 2021
1 vote
2 answers
How can I tell if there is a pattern break? We have a canvas with a shape on it. We need an algorithm to determine if the figure has one object or several. Where can I find such an algorithm? Thanks ...
by gena-tile
asked Sep 19, 2021
7 votes
3 answers
1 vote
1 answer
How do I send a user-created image to the server using js, ajax or fetch()? Good afternoon. 1) User draws a picture on canvas and the program converts it to a png picture. I need this picture to be sent to the server without reloading the page, ...
by Anton05
asked Apr 4, 2021
1 vote
1 answer
Interactive image modification on canvas, how? I want to know how to add an image to canvas and be able to drag and resize it, like in Photoshop, so that the selected image appears in a frame and by dragging the edge ...
1 vote
1 answer
image
How do I create a line type canvas chart? Good evening! I'm not quite able to use Chart.js to create small line type charts. With large, different type, no problem! My code is below: <canvas style="width: 100 ...
by Alex_87
asked Mar 29, 2021
1 vote
1 answer
image
What can be used to make charts and graphs? Please help me make graphs and charts. I do not know which library and how to do it. And we need to do the following: ...
by Alex_87
asked Mar 29, 2021
1 vote
1 answer
1 vote
1 answer
How can I draw and round two avatars in Canvas? Good afternoon, I am trying to display two avatars in canvas, without rounding - is displayed, if I do rounding only the first all is displayed. I make rounding of the s ...
by outplayedrq
asked Mar 26, 2021
1 vote
1 answer
Is it possible to find out the coordinates of the square inside the canvasa? codepen.io/Mbreti/pen/YzqMoEP When you click inside the canvasa (at any point) the square should move and not teleport under the mouse How can it be implemented ? as ...
by Mbreti
asked Mar 26, 2021
1 vote
1 answer
image
How do I make a gradient from the darkest to the lightest shade of one color on canvas? How can I make the selected color in the square palette appear in different shades in the palette on the right side of canvas (like in paint)? (the first palette is made ...
by prizmer
asked Mar 23, 2021
1 vote
1 answer
image
Is the line not correctly positioned relative to the canvas cursor? According to the lesson did a trivial drawing on the js and decided to add on top of the buttons added and now when I draw what I draw is drawn below the cursor for abou ...
by Soldat2283
asked Mar 22, 2021
1 vote
1 answer
How do I catch the moment when the video is ready to be previewed? I'm trying to catch the moment when you can do a preview with the js of the video tag. Tried these events, but I get a black image: <video src="i.video" preload="meta ...
by devopg
asked Mar 21, 2021
2 votes
2 answers
Binary protocols or JSON to create a Web game? Hello, dear programmers!) what is the best way to create a Web-game with PIXI + NODE JS? (binary protocols, or JSON) I just don't know much about binary data. and is it ...
by Triborg-333
asked Mar 21, 2021
1 vote
1 answer
Is it possible to blur the axes (in a certain direction) on canvas? For blurring, canvas provides blur filter . But this filter blurs the image evenly, which makes it impossible to achieve the motion blur effect. I tried. Ease JS filte ...
by Magneto903
asked Mar 21, 2021
1 vote
2 answers
Can you help me understand how and when the functions work? Hello all! I have already asked a similar question before, but it was rejected for its bulkiness), so this time I ask to understand how some points in the code work. So, ...
by Bersonazh
asked Mar 21, 2021