To change the display mode of the user’s screen to 640x400 and leave the current colour depth at the default setting, use the following syntax:
ChangeDisplayMode(0)
You can check if this function does change the user’s screen display by checking the Return Value. If the Return Value is true, the display mode was changed, if false it was not. In the example below, the mode is changed to 800x600.
var ModeChanged = ChangeDisplayMode(1)
if (ModeChanged)
{
//when display mode changed run these statements
}
else
{
// when display mode NOT changed run these statements
}
Note:
The else function could contain a list of statements indicating what to do if the display mode was not changed, such as trying again with a different display mode or showing a warning message to the user.