I read DA's post after mine, and realised you can also set full screen (thanks DA, I had assumed that setting fullscreen was only possible at the start of the program!). Here is the amended code.
If you want full screen and a lower resolution, then you can set the Virtual Resolution to be lower than the device resolution.
// Project: test
// Created: 2016-02-10
// set window properties
SetWindowTitle( "test" )
SetWindowSize( 1024, 768, 0 )
// set display properties
SetVirtualResolution( 1024, 768 )
SetOrientationAllowed( 1, 1, 1, 1 )
global vw
global vh
global ts
global fs
global option
global opt as integer[3]
fs = 0
option = 2
opt[0] = createText("Full")
opt[1] = createText("640x480")
opt[2] = createText("1024x768")
opt[3] = createText("1280x720")
for n = 0 to 3
SetTextAlignment(opt[n],1)
next n
fs = 0
setScreenParms()
setText()
do
if GetPointerReleased() = 1
for n = 0 to 3
if GetTextHitTest(opt[n], getpointerx(), getpointery()) = 1
if n = 0 and fs = 1 then n = 2
option = n
setScreenParms()
setText()
// full/windowed
if option = 0
if fs = 0
fs = 1
SetTextString(opt[0], "Windowed")
else
fs = 0
SetTextString(opt[0], "Full")
endif
endif
exit
endif
next n
endif
sync()
loop
function setText()
log("text Size = " + str(ts))
for n = 0 to 3
SetTextSize(opt[n], ts)
settextposition(opt[n], vw/2, (vh * 0.3) + (vh * n * 0.1))
if n = option
SetTextColor(opt[n],212,255,212,255)
else
SetTextColor(opt[n],255,255,255,255)
endif
next n
endfunction
function setScreenParms()
select option
case 0
SetWindowSize(GetDeviceWidth(),GetDeviceHeight(),1)
SetVirtualResolution(GetDeviceWidth(),GetDeviceHeight())
endcase
case 1
SetWindowSize(640,480,0)
SetVirtualResolution(640,480)
endcase
case 2
SetWindowSize(1024,768,0)
SetVirtualResolution(1024,768)
endcase
case 3
SetWindowSize(1280,720,0)
SetVirtualResolution(1280,720)
endcase
endselect
vw = GetVirtualWidth()
vh = GetVirtualHeight()
ts = 40 * (vw/1024.0)
endfunction
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Quidquid latine dictum sit, altum sonatur
TutCity is being rebuilt