Usar drawText en win.ts
This commit is contained in:
parent
97d97508e7
commit
aca00b6bb2
1 changed files with 4 additions and 4 deletions
|
@ -1,4 +1,5 @@
|
|||
import { Juego } from './main'
|
||||
import { drawText } from './utils'
|
||||
|
||||
export type State = {
|
||||
current: "win"
|
||||
|
@ -8,8 +9,7 @@ export function update(juego: Juego<State>, dt: number) {
|
|||
}
|
||||
|
||||
export function draw(juego: Juego<State>, timestamp: number) {
|
||||
juego.ctx.font = `bold 3rem sans-serif`
|
||||
const winText = '¡Salvaste la costanera!'
|
||||
const winTextMeasure = juego.ctx.measureText(winText)
|
||||
juego.ctx.fillText(winText, juego.canvas.width / 2 - winTextMeasure.width / 2, 100)
|
||||
drawText(juego, '¡Salvaste la costanera!',
|
||||
{ x: juego.canvas.width / 2, y: 100 },
|
||||
{ bold: true, size: 3, align: 'center' })
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue