Changed stroke color of menu
This commit is contained in:
parent
06a982747e
commit
6aed092c24
3 changed files with 10 additions and 3 deletions
1
game.js
1
game.js
|
@ -67,6 +67,7 @@ window.addEventListener("load", async () => {
|
|||
getContext: (elem, type) => elem.getContext(type),
|
||||
setGlobalAlpha: (ctx, alpha) => ctx.globalAlpha = alpha,
|
||||
setFillColor: (ctx, color) => ctx.fillStyle = color,
|
||||
setStrokeColor: (ctx, color) => ctx.strokeStyle = color,
|
||||
setFont: (ctx, font) => ctx.font = font,
|
||||
setTextAlign: (ctx, align) => ctx.textAlign = align,
|
||||
clearRect: (ctx, x, y, w, h) => ctx.clearRect(x, y, w, h),
|
||||
|
|
6
game.scm
6
game.scm
|
@ -749,11 +749,13 @@
|
|||
(y (- (vec2-y center) (* tile-height (floor (/ height 2))))))
|
||||
;; Draw menu background
|
||||
(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))
|
||||
(h (* tile-height height)))
|
||||
(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
|
||||
(set-text-align! context "center")
|
||||
(set-font! context "normal 16px monogram")
|
||||
|
|
|
@ -25,11 +25,12 @@
|
|||
#:export (get-context
|
||||
set-global-alpha!
|
||||
set-fill-color!
|
||||
set-stroke-color!
|
||||
set-font!
|
||||
set-text-align!
|
||||
clear-rect
|
||||
fill-rect
|
||||
;; stroke
|
||||
stroke-rect
|
||||
fill-text
|
||||
draw-image
|
||||
restore!
|
||||
|
@ -52,6 +53,9 @@
|
|||
(define-foreign set-fill-color!
|
||||
"canvas" "setFillColor"
|
||||
(ref extern) (ref string) -> none)
|
||||
(define-foreign set-stroke-color!
|
||||
"canvas" "setStrokeColor"
|
||||
(ref extern) (ref string) -> none)
|
||||
(define-foreign set-font!
|
||||
"canvas" "setFont"
|
||||
(ref extern) (ref string) -> none)
|
||||
|
|
Loading…
Add table
Reference in a new issue