Resizing the canvas after game has begun?

2 replies to this topic
Posted 1+ years ago #1
Soap

I've created some Javascript which resizes my game's <canvas> window between 1024x768 and 800x600 for people with smaller screens, but I cannot seem to figure out what else I need to change to get the game to change its own resolution. The game is using diddy's virtual resolution. Changing game_canvas is not enough...

I can force the game to restart but that's not ideal.

 
Posted 1+ years ago #2
bruZard

you can do that with my module "utils" > http://www.sedm.de/monkey/utils.zip

myCanvas:= New UtilsCanvas()
myCanvas.Resize(800, 400)

... or full screen with autoresize:

myCanvas.autoResize()
 
Posted 1+ years ago #3
Soap

Here is what ended up working:

bb_framework_DEVICE_WIDTH=800;
bb_framework_DEVICE_HEIGHT=600;
bb_framework_game.m_SetScreenSize(1024.0,768.0,false)
diddy.setGraphics(800,600);