We are about to switch to a new forum software. Until then we have removed the registration on this forum.
So far, I've tried several approaches to getting editable text, but I'm kinda stuck.
In my first attempt, I tried to make the text a html element via createInput() (using CSS to make the input box transparent) and basically 'overlay' it on top of my canvas. The problem with this was that html elements use different coordinate system to the canvas, so I couldn't get them to sync properly.
In my second attempt, I read about fillText(), but this required canvas.getContext("2d") to be called, and that didn't work with var canvas = createCanvas(). Instead, I would have to use var canvas = document.getElementById("canvas"), where "canvas" was the ID of the canvas html environment. However, for some reason, when I used document.getElementById, my canvas became really small and no attempts to change its dimensions or position worked.
So yeah, I'm kinda stuck. What is the recommended way of adding editable text?
Thanks, those look promising! I'll let you know how I go with it.
edit: Seems to work fine, thanks!