Skip to main content

All Questions

0 votes
2 answers
59 views

How to create a cricket score ticker like this and populate it with API data in a React app? [closed]

When I was watching a live sports broadcast (cricket) on TV, I noticed an overlay showing match details with beautiful graphics and animations. It really caught my eye, and I’d love to build something ...
GOBINDA CHANDRA's user avatar
0 votes
1 answer
45 views

HTML Canvas Won't Draw

I'm trying to learn the HTML canvas, but nothing is drawing on my canvas element. What would be the best way to proceed from here? (complete canvas beginner) HTML <!DOCTYPE html> <html lang=&...
Elsa's user avatar
  • 45
1 vote
1 answer
112 views

Adding a Transparent Border Outline to an Overlay Image in Canvas

I am working on a project where I overlay an image on an HTML Canvas and add rounded corners and a shadow to it. However, I'm facing an issue where there is an unwanted white inline border inside the ...
Aviato's user avatar
  • 119
0 votes
1 answer
211 views

How to rotate groups of objects around pivot in JS (Graphics Programming)

I am working on making a lightweight and simple 2d engine in HTML Canvas with JavaScript, and I am working on inheritance. For example, I have two structures, an entity class and a container class. (...
Vinny's user avatar
  • 83
0 votes
1 answer
436 views

"Uncaught TypeError: Cannot read properties of undefined (reading '310')" when running Canvas animation

I'm working on another tunnel effect demo. This time I'm trying to make the tunnel move within the image. However, the function that handles rendering the tunnel always throws an error, and I'm not ...
Matthew Miller's user avatar
0 votes
0 answers
89 views

What's causing this tunnel effect to render incorrectly?

I'm currently attempting to create a sort of 3D tunnel effect in Javascript using the canvas tag. It works, in the sense that it actually renders something, but it looks like this: Not only is that ...
Matthew Miller's user avatar
2 votes
1 answer
748 views

Why there's white line appears in HTML canvas between two shape?

Why there's white line appears in JS canvas between two shape? I'm making a game with JS / TS (I'm using MacBook Pro), with HTML5 canvas, and there's a unexpected white line appear between two shapes ...
Cflowe Visit's user avatar
1 vote
2 answers
123 views

HTML5 Canvas diagonal lines get thicker or bolder after drawing another line somewhere else on the canvas (not on top) [duplicate]

For horizontal and vertical lines, using translation of 0.5 for odd stroke widths produces crisper/sharper lines. How about the diagonal lines? Link to jsfiddle <!DOCTYPE html> <html lang=...
user3330840's user avatar
  • 7,419
0 votes
1 answer
439 views

Check if point is inside of shape drawn by a complex Path2D

I want to check if a given point is inside of the space drawn inside of a irregular path - inside of the brain (the path is below). I don't seem to be able to use CanvasRenderingContext2D....
Sérgio LP's user avatar
1 vote
1 answer
1k views

Zoom In Canvas And Then Zooming Out in a different mouse position Breaks Background Display

I'm trying to implement a zoom function on my canvas keeping the mouse position relative to where it was before. This function accomplishes it almost. And here is a full example: https://codepen.io/...
Pablo Estrada's user avatar
0 votes
1 answer
250 views

Text won't update in the view - fabricjs

I'm using fabricjs to make a ruler tool. When the user click on the canvas it will draw a small rectangle and a line (with length of 0) as the user starts to move the mouse the length of line ...
Zullu's user avatar
  • 171
0 votes
1 answer
84 views

Moire effect when rotating rectangle using setTransform

I've been playing around with using matrices to hold transforms for 2D elements in canvas. setTransform works pretty well for this, but I ran into an interesting issue where I get the Moire effect ...
Danman's user avatar
  • 496
2 votes
1 answer
2k views

How Can I Prevent Texture Bleeding When Using drawImage To Draw Multiple Images From A Tile Sheet, Sprite Sheet, Or Texture Atlas?

I am using the HTML5 canvas API to draw a tile map for a pixel art game. The rendered tile map is comprised of many smaller images that are cut out of a single source image called a tile sheet. I am ...
Frank's user avatar
  • 2,240
4 votes
1 answer
74 views

Problem with positioning circles in HTML Canvas element

The following image is a picture of three rotating disks on the theming of Smiler at Alton Towers: My goal is to draw the rightmost spinner (the one circled in red) on an HTML canvas, using 27 circles ...
user avatar
-1 votes
1 answer
73 views

Why my rectangle does not move when i update x-axis?

I am trying to make simple animation in canvas, trying to move a rectangle to right by updating x-axis but it does not work I don't know why? I am stuck, i need help and thanks? class main // ...
CoderDot's user avatar

15 30 50 per page