Questions tagged as 'canvas'

1
answer

Calculations used to rotate an image on canvas

I have the following code below to be able to rotate an image through canvas . function qs(selector) { return document.querySelector(selector); } function rotacionar(canvas, image, angle)...
asked by 07.04.2017 / 19:08
2
answers

How to clean a canvas area?

I created a function that is generating random objects in the canvas area and wanted to clear the area after the function was finished. Is there any way to do this?     
asked by 17.02.2014 / 06:51
1
answer

Move character sprite on canvas and change image [closed]

Well, I would like to know how I could implement a sprite on my canvas, I am very lay with canvas, the idea is, by pressing arrow -> he runs the sprite 1.png, the squeeze arrow < - he runs the sprite 2.png, and when left click he performs spr...
asked by 19.06.2016 / 01:00
1
answer

Rotate an arrow on a canvas

I need to draw a stream dynamically based on the user's choices. In this flow I want to draw the chosen hypotheses (blue circles with numbers) and the direction between the choices (lines with arrows). For example: node 1 for node 2. JSFiddl...
asked by 16.01.2015 / 11:13
2
answers

Collision system for game in html5!

I'm learning a little about games in html5, css and js. I made a very basic gameplay, player movement, enemy and a collision system , see: var canvas;//o elemento canvas sobre o qual desenharemos var ctx;//o "contexto" da canvas que s...
asked by 04.05.2018 / 02:25
4
answers

What is the canvas tag for?

I was searching some information and saw that there is a tag called <canvas> in HTML5. What does canvas tag do? Is it only for geometric shapes? If it is possible and feasible, could you give an example? In this other qu...
asked by 28.06.2017 / 20:07
1
answer

Write on the Javascript screen

I need to make an area on the form that the user digitally signs with a touch screen pen to store the signature of the same. As if he were writing on paper but on screen. I read about the Canvas but I just learned to make lines, rectangles...
asked by 02.03.2017 / 20:20
1
answer

Resize an image in a canvas element with js

Problem Image resizing with JavaScript Possible Solution Use the canvas element to redraw the image, resize it and then render the image again. Below are two use cases that are merely illustrative, because the sizes of the imag...
asked by 22.06.2015 / 01:20
2
answers

Canvas erase correct text

I go through a search and there is no way to make it work, the first attempt works fine, but the second does not, that is, does not delete the text that was there and replace it with the new one (in the corresponding field), I assume that my...
asked by 19.01.2017 / 15:48
1
answer

Resolution of equations

I created a Cartesian plan and I get the user an equation whatsoever. My goal is to draw this equation on the plane. I'm doing this using canvas. But here comes a problem, I can only do this if I separate each type of equation (circle, straight...
asked by 13.12.2014 / 02:30