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:
parent
7d4d6115a4
commit
afef0fd480
5 changed files with 174 additions and 76 deletions
7
game.js
7
game.js
|
@ -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()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue