I'm trying my hand at creating a tool for users to upload and annotate an image, then save to database. The tool allows drawing lines, adding text and erasing. Now when it comes to adding text,an svg sulution might be better, but haven't found one that dynamically loads a background image.
Anyway, users need to be able to add multiple pieces of text and move them on the image. For this to happen I neede to be able to create layer for the text pieces dynamically, i.e. when the text button is clicked and the text field has some text in it.
At the moment, the text gets added ontop of the canvas in the same position. How can I loop the creation of layers, say in this function:
function draw_text() {
ctx.fillStyle = "blue";
ctx.font = "12pt Helvetica";
ctx.fillText($('#text_entry').val(), 10, 250);
}