Questions tagged as 'html5-canvas'

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
1
answer

How to find out the rendered size of a curve in html5 canvas 2d?

I need to figure out the rendered size of a curve on 2d canvas context.bezierCurveTo(cp1x, cp1y, cp2x, cp2y, x, y); with this code, for example // pontos de controle var cp1x = 200, cp1y = 150, cp2x = 260, cp2y = 10; var x =...
asked by 08.09.2016 / 13:36
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

How do I delete a specific object on the HTML5 canvas?

Well, for example I have two rectangles drawn on canvas: const canvas = document.getElementById('canvas') const context = canvas.getContext('2d'); context.fillRect(20,20,150,100); context.fillRect(300,300,150,100); <canvas id="c...
asked by 27.07.2018 / 16:33
2
answers

How to get X and Y from Canvas Click

I would like to get X and Y from a click on my canvas. var canvas;//o elemento canvas sobre o qual desenharemos var ctx;//o "contexto" da canvas que será utilizado (2D ou 3D) var dx = 5;//a tava de variação (velocidade) horizontal do obj...
asked by 20.05.2018 / 02:00
0
answers

Canvas draw grid as backgound

I searched, but did not find much information. What I want to do is draw a grid as a background on the canvas. I saw some examples with svg and others directly on canvas. Assuming I'll be able to zoom in and drag the canvas scenery among other i...
asked by 22.08.2018 / 01:49
1
answer

WEBCAM without Flash

I'm trying to take a picture with a webcam ... I'm relatively new to Javascript and I'm taking a chorus! Follow my code: //função para iniciar a camera function startCamera(){ navigator.mediaDevices.getUserMedia({ vide...
asked by 20.07.2018 / 15:05
0
answers

Canvas Facebook

I would like to know if anyone knows how I create the Canvas on the face and put it on my external page, as itau did. link I have already broken my head and could not, can anyone help me?     
asked by 25.09.2018 / 20:04
0
answers

Flash animations converted to HTML5 do not fit in div

I converted a series of flash animations to HTML5, but after the conversion the animations (now in html5) are not set inside the DIV. Before the conversion it was like this: <video src="caminho/animacao.swf" autoplay controls ></vi...
asked by 08.12.2017 / 12:13
0
answers

img inside div does not appear when used canvas2image

I'm using a script to save a div in png. Within this div has one, but this image does not appear in the final result after saving. The code I'm using is this $(function() { $("#btnSave").click(function() { html2canvas($(".container-assin...
asked by 06.11.2017 / 19:25