canvas: Add strokeRect binding.
This commit is contained in:
parent
f6c7d000c0
commit
5e4d6cce1c
2 changed files with 4 additions and 0 deletions
1
game.js
1
game.js
|
@ -71,6 +71,7 @@ window.addEventListener("load", async () => {
|
|||
setTextAlign: (ctx, align) => ctx.textAlign = align,
|
||||
clearRect: (ctx, x, y, w, h) => ctx.clearRect(x, y, w, h),
|
||||
fillRect: (ctx, x, y, w, h) => ctx.fillRect(x, y, w, h),
|
||||
strokeRect: (ctx, x, y, w, h) => ctx.strokeRect(x, y, w, h),
|
||||
fillText: (ctx, text, x, y) => ctx.fillText(text, x, y),
|
||||
drawImage: (ctx, image, sx, sy, sw, sh, dx, dy, dw, dh) => ctx.drawImage(image, sx, sy, sw, sh, dx, dy, dw, dh),
|
||||
restore: (ctx) => ctx.restore(),
|
||||
|
|
|
@ -63,6 +63,9 @@
|
|||
(define-foreign fill-rect
|
||||
"canvas" "fillRect"
|
||||
(ref extern) f64 f64 f64 f64 -> none)
|
||||
(define-foreign stroke-rect
|
||||
"canvas" "strokeRect"
|
||||
(ref extern) f64 f64 f64 f64 -> none)
|
||||
(define-foreign fill-text
|
||||
"canvas" "fillText"
|
||||
(ref extern) (ref string) f64 f64 -> none)
|
||||
|
|
Loading…
Add table
Reference in a new issue