Rewrite existing credits

Each credit has its own draw function

Credits outside of the visible game area are not drawn
This commit is contained in:
Amy Grinn 2025-01-08 12:26:08 -05:00
parent 7d4d6115a4
commit afef0fd480
No known key found for this signature in database
GPG key ID: 6B558BED1DCF3192
5 changed files with 174 additions and 76 deletions

View file

@ -81,7 +81,12 @@ window.addEventListener("load", async () => {
translate: (ctx, x, y) => ctx.translate(x, y),
rotate: (ctx, angle) => ctx.rotate(angle),
setTransform: (ctx, a, b, c, d, e, f) => ctx.setTransform(a, b, c, d, e, f),
setImageSmoothingEnabled: (ctx, enabled) => ctx.imageSmoothingEnabled = (enabled == 1)
setImageSmoothingEnabled: (ctx, enabled) => ctx.imageSmoothingEnabled = (enabled == 1),
measureText: (ctx, text) => ctx.measureText(text),
},
textMetrics: {
actualBoundingBoxAscent: (metrics) => metrics.actualBoundingBoxAscent,
actualBoundingBoxDescent: (metrics) => metrics.actualBoundingBoxDescent,
},
math: {
random: () => Math.random()