It is planned for the use as an UI element. And I do not know the radius yet. So I would really love if someone could have an example on how to use drawingcanvas eventing or javascript.
I found things like
function roundRect(x, y, w, h, radius) {
var canvas = document.getElementById("canvas6");
var context = canvas.getContext("2d");
var r = x + w;
var b = y + h;
context.beginPath();
context.strokeStyle="green";
context.lineWidth="4";
context.moveTo(x+radius, y);
context.lineTo(r-radius, y);
context.quadraticCurveTo(r, y, r, y+radius);
context.lineTo(r, y+h-radius);
context.quadraticCurveTo(r, b, r-radius, b);
context.lineTo(x+radius, b);
context.quadraticCurveTo(x, b, x, b-radius);
context.lineTo(x, y+radius);
context.quadraticCurveTo(x, y, x+radius, y);
context.stroke();
}
in the Javascript documentation. But many times when I try to use plain Javascript I get errors when testing the game.
When I use this with roundRect(700, 600, 200, 200, 10) I get "Cannot read property 'getContext' of null".