Add button interaction

This commit is contained in:
asraelite 2018-03-02 22:30:26 +00:00
parent 6223b35536
commit 4a253b0184
12 changed files with 247 additions and 23 deletions

View file

@ -26,7 +26,12 @@ function renderImage(element) {
}
function renderButton(element) {
context.fillStyle = '#983';
if (element.mouseHeld) {
context.fillStyle = '#706244';
} else {
context.fillStyle = element.mouseOver ? '#ad9869' : '#917f58';
}
context.fillRect(...element.shape);
context.strokeStyle = '#541';
context.strokeWidth = 4;