Hello and welcome to the forum,
Yes, you can make the canvas full screen,
Already with CSS,
#rpg {
width: 100%;
height: 100%;
}
Canvas element size automatically adapts to its parent element
Finally, you can take the element and make it full screen.
In the src/modules/main/client/index.ts
import { RpgClient, RpgModule, RpgClientEngine } from '@rpgjs/client'
@RpgModule<RpgClient>({
engine: {
onStart() {
const rpgEl = document.getElementById('rpg')
rpgEl?.addEventListener('click', () => {
rpgEl.requestFullscreen()
})
}
}
})
export default class RpgClientModuleEngine {}
Or main/client.ts
in v4:
export default {
onStart() {
const rpgEl = document.getElementById('rpg')
rpgEl?.addEventListener('click', () => {
rpgEl.requestFullscreen()
})
}
}