Questions tagged [canvas]
Canvas is a drawing element introduced to web development with HTML5.
186 questions
10
votes
3
answers
2k
views
A Rubik's Cube game in Python
I implemented this Rubik's Cube game in Python, using Canvas and Context2d for user interaction. This was mainly an exercise in &...
3
votes
1
answer
106
views
A JavaFX canvas - based UI view component for representing data points in three dimensions
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
...
3
votes
1
answer
119
views
A JavaScript plugin for rendering radial pie charts
(See also An extended JavaScript plugin for rendering radial pie charts.)
I have this JavaScript plugin:
rodde-radial-pie-chart.js:
...
4
votes
1
answer
308
views
Snake game using Canvas API
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 ...
8
votes
2
answers
975
views
Python - Tkinter - Infinite Canvas World for drawing apps
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 ...
0
votes
0
answers
72
views
I've coded a javascript snake game, but i'm not sure if i've used module pattern correctly
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 ...
1
vote
2
answers
2k
views
Animate circle using Javascript and HTML5 Canvas
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 ...
2
votes
1
answer
147
views
Generate Multiple Instances of Canvas-based UI Object
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 ...
2
votes
1
answer
306
views
Javascript speed of an animated object (planet orbiting sun)
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 ...
3
votes
0
answers
65
views
HTML 5 Canvas Drawing app
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 ...
9
votes
2
answers
489
views
Optimize a tile rendering algorithm for Swing Canvas
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 ...
11
votes
1
answer
603
views
Battle City (Tank) replica
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,...
2
votes
0
answers
383
views
Canvas Drawing / Bucket Filing Kotlin
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 ...
6
votes
3
answers
1k
views
Performance in particles.js library
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 ...
2
votes
1
answer
1k
views
d3.js canvas performance
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 ...
5
votes
2
answers
2k
views
Edge detection in a canvas
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.
...
2
votes
1
answer
117
views
React component to animate planets on a canvas
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:
...
6
votes
1
answer
499
views
Tetris Game Javascript
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 ...
1
vote
1
answer
631
views
Upload image without src attribute
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 ?...
2
votes
1
answer
212
views
Mandelbrot Set generator
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 ...
3
votes
2
answers
2k
views
JavaScript flood fill
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 ...
4
votes
1
answer
381
views
Sierpinski’s Gasket Triangle in JavaScript
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?
...
1
vote
2
answers
227
views
Wireframe animation on canvas is slow
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. ...
2
votes
2
answers
209
views
A function that generates arrays of video thumbnails using canvas
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 ...
0
votes
1
answer
846
views
Breaking up a simple Paint application into smaller classes
(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 ...