H
H
hollanditkzn2017-02-08 17:50:57
JavaScript
hollanditkzn, 2017-02-08 17:50:57

How to change font in canvas using select?

How to implement font change using select. With input it became clear to me, but with select it is not clear, maybe some event should be selected there?
https://jsfiddle.net/hollanditkzn/13txdyfb/4/

Answer the question

In order to leave comments, you need to log in

1 answer(s)
P
Pavel Antonov, 2017-02-08
@hollanditkzn

well, everything is right with you, you just need to do this when changing the select

ctx.clearRect(0, 0, canvas.width, canvas.height);
  ctx.fillText($("#textInput").val(), 20, 20);

otherwise, there is simply no change in the context of the canvas)
https://jsfiddle.net/4f10me0d/

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question