Skip to main content

Questions tagged [canvas]

Canvas is a drawing element introduced to web development with HTML5.

Filter by
Sorted by
Tagged with
10 votes
3 answers
2k views

I implemented this Rubik's Cube game in Python, using Canvas and Context2d for user interaction. This was mainly an exercise in &...
QuadmasterXLII's user avatar
3 votes
1 answer
106 views

I have this pie chart. It encodes data points in three dimensions, which are encoded via sector radius, sector angle, color intensity of the sector. How it looks like? (See here.) Code ...
coderodde's user avatar
  • 32.3k
3 votes
1 answer
119 views

(See also An extended JavaScript plugin for rendering radial pie charts.) I have this JavaScript plugin: rodde-radial-pie-chart.js: ...
coderodde's user avatar
  • 32.3k
4 votes
1 answer
308 views

Edit 2: For anyone interested, you can play the game at buggysnake.com Edit 1: I have typed up the code for making the body of the snake move. It's not perfect and there are small problems I need to ...
Seeker's user avatar
  • 143
8 votes
2 answers
975 views

We have worked an idea out that seems to have a wide usecase and there seems to be no examples for it on the web for python tkinter. Having unlimited space to draw can be crucial and can be done wrong ...
Thingamabobs's user avatar
0 votes
0 answers
72 views

I've wrapped everything inside a gamecontroller, so that everything is private, was this a good idea? that was my first time using oop and module pattern. also the code is in a good shape, or must be ...
leo___'s user avatar
  • 9
1 vote
2 answers
2k views

Animate circle using Javascript and HTML5 Canvas. The circle will be drawn at the center of the canvas. The initial radius will be 0 and will keep on increasing till 100 and then decrease till 0 and ...
user avatar
2 votes
1 answer
147 views

Background I'm interested in implementing a small script to display multiple independent instances of a Canvas-based control on one page. The ultimate intention is to add many similar controls to the ...
DaveL17's user avatar
  • 123
2 votes
1 answer
306 views

So I am pretty new to JavaScript and I thought I might make an animation demonstrating a planet orbiting a sun in an elliptical orbit using Kepler's laws. I am struggling to get the speed right. So I ...
Yasser's user avatar
  • 23
3 votes
0 answers
65 views

I made a small simple drawing app using HTML5 Canvas, learning how to use canvas. You can right click to change color, scroll to change brush size, and click + drag to draw on the screen. Any feedback ...
async await's user avatar
9 votes
2 answers
489 views

I have an algorithm that I use to render a text GUI using Swing's Canvas, it looks like this in practice: My goal is to reach 60 frames per second for a full HD ...
Adam Arold's user avatar
11 votes
1 answer
603 views

I'm learning JS and Canvas. A friend of mine gave me the task to create a Battle City replica. I've already managed to make the map and the player to move. Nothing fancy just some squares with a color,...
Frakcool's user avatar
  • 191
2 votes
0 answers
383 views

I have completed a solution for the below problem and uploaded it in Git Repo. I would be grateful if somebody can review in term of code quality, design and Kotlin language usage. Repo You're ...
Ramanathan Ganesan's user avatar
6 votes
3 answers
1k views

Hey I'm trying to optimise particles.js library from Vincent Garrau in order to get 60fps @ 500 particles ~. I've already refactored the code to use a quad tree instead but it does not seem to be ...
Ado Ren's user avatar
  • 163
2 votes
1 answer
1k views

I've just rewritten this code (a simple gravitational restricted n-body simulation) to display using canvas, rather than SVG. The reason being that I'd like to be able to run it with many thousands of ...
zephyr's user avatar
  • 153
5 votes
2 answers
2k views

I have one function in my code to detect edges in a canvas but it's the slowest part of my code and is used everywhere. If I could just optimise this, my whole program would speed up considerably. ...
Hasen's user avatar
  • 173
2 votes
1 answer
117 views

I wrote some JavaScript to generate some graphics on a canvas, on a regular HTML page. I now want the same code to run in a component that is part of a React app. I've done this: ...
Alex's user avatar
  • 123
6 votes
1 answer
499 views

I am creating Tetris in javascript. I have finished the basic mechanics. I would appreciate some feedback on how I could improve it. Down, left, and right arrow keys move the piece while the up arrow ...
Joyal Mathew's user avatar
1 vote
1 answer
631 views

We gave an option for user to Upload the image Image is uploading fine, but its not adding any img src tag for that uploaded image.... Is this is acceptable to upload image without using any img tag ?...
vickey colors's user avatar
2 votes
1 answer
212 views

I want to reduce the big time it needed for my mandelbrot set generator to work. I'm working this for already a week. I tried to reduce the canvas size from 400 by 400 to 200 by 200 and the speed ...
MMJM's user avatar
  • 173
3 votes
2 answers
2k views

I tried to implement a very simple color flood fill to experiment a bit with Javascript. All comments about the code are welcome but I am especially interested in performance as it seems to be a bit ...
Corporal Touchy's user avatar
4 votes
1 answer
381 views

I wrote the Sierpinski’s Gasket Triangle in JavaScript, but I feel the code can be better, especially from L32 to L47. Could you make it more organized? ...
Zeyad's user avatar
  • 230
1 vote
2 answers
227 views

I'm recently working on a project that involves animation in the background. It works well on desktop but performance drops drastically on mobile. I'm using Paper.js to import a svg and animate it. ...
Julian Tong's user avatar
2 votes
2 answers
209 views

I have just finished my first version of a function that returns an array of video screenshots created with canvas. What I am looking for are ways to improve this speed by as much as possible. I want ...
Vera Perrone's user avatar
0 votes
1 answer
846 views

(Sorry this is a repeat post, I hadn't logged in on my initial question and am unable to respond) I currently have a working code for a simple paint application but it is all in one file and very ...
HR32's user avatar
  • 1