Changed stroke color of menu

This commit is contained in:
Amy Grinn 2024-12-17 12:33:36 -05:00
parent 06a982747e
commit 6aed092c24
No known key found for this signature in database
GPG key ID: 6B558BED1DCF3192
3 changed files with 10 additions and 3 deletions

View file

@ -67,6 +67,7 @@ window.addEventListener("load", async () => {
getContext: (elem, type) => elem.getContext(type), getContext: (elem, type) => elem.getContext(type),
setGlobalAlpha: (ctx, alpha) => ctx.globalAlpha = alpha, setGlobalAlpha: (ctx, alpha) => ctx.globalAlpha = alpha,
setFillColor: (ctx, color) => ctx.fillStyle = color, setFillColor: (ctx, color) => ctx.fillStyle = color,
setStrokeColor: (ctx, color) => ctx.strokeStyle = color,
setFont: (ctx, font) => ctx.font = font, setFont: (ctx, font) => ctx.font = font,
setTextAlign: (ctx, align) => ctx.textAlign = align, setTextAlign: (ctx, align) => ctx.textAlign = align,
clearRect: (ctx, x, y, w, h) => ctx.clearRect(x, y, w, h), clearRect: (ctx, x, y, w, h) => ctx.clearRect(x, y, w, h),

View file

@ -749,11 +749,13 @@
(y (- (vec2-y center) (* tile-height (floor (/ height 2)))))) (y (- (vec2-y center) (* tile-height (floor (/ height 2))))))
;; Draw menu background ;; Draw menu background
(if (= r r-start) (if (= r r-start)
(let* ((x1 (- (vec2-x center) (* tile-width (floor (/ width 2))))) (let* ((x (- (vec2-x center) (* tile-width (floor (/ width 2)))))
(w (* tile-width width)) (w (* tile-width width))
(h (* tile-height height))) (h (* tile-height height)))
(set-fill-color! context "#000") (set-fill-color! context "#000")
(fill-rect context x1 y w h))) (fill-rect context x y w h)
(set-stroke-color! context "blue")
(stroke-rect context x y w h)))
;; Draw menu text ;; Draw menu text
(set-text-align! context "center") (set-text-align! context "center")
(set-font! context "normal 16px monogram") (set-font! context "normal 16px monogram")

View file

@ -25,11 +25,12 @@
#:export (get-context #:export (get-context
set-global-alpha! set-global-alpha!
set-fill-color! set-fill-color!
set-stroke-color!
set-font! set-font!
set-text-align! set-text-align!
clear-rect clear-rect
fill-rect fill-rect
;; stroke stroke-rect
fill-text fill-text
draw-image draw-image
restore! restore!
@ -52,6 +53,9 @@
(define-foreign set-fill-color! (define-foreign set-fill-color!
"canvas" "setFillColor" "canvas" "setFillColor"
(ref extern) (ref string) -> none) (ref extern) (ref string) -> none)
(define-foreign set-stroke-color!
"canvas" "setStrokeColor"
(ref extern) (ref string) -> none)
(define-foreign set-font! (define-foreign set-font!
"canvas" "setFont" "canvas" "setFont"
(ref extern) (ref string) -> none) (ref extern) (ref string) -> none)