Add button interaction
This commit is contained in:
parent
6223b35536
commit
4a253b0184
12 changed files with 247 additions and 23 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue