U
U
Urukhayy2017-11-14 16:29:03
JavaScript
Urukhayy, 2017-11-14 16:29:03

How to implement this in canvas?

Task: By mouse click, draw a picture at its coordinates, and delete it after a few seconds. At the same time, each picture has its own timer (there can be many such pictures created at the same time). I made one canvas and an array of contexts. But when clearing one context, all contexts are cleared at once. Need to make multiple canvas? Or what's the best way to implement it?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vitaly Stolyarov, 2017-11-14
@Urukhayy

on one canvas, you cannot draw differently from several contexts, they all come down to one canvas.
Maybe canvas's are not needed at all? Why not work through the DOM (virtually everything is there - filters, transformations)?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question