Hello, MadBit and Guys.
Is it a standard specification of nuklear GUI that nkSysc() does not support fullscreen by SetWindowSize(x, y, 1)?
// Project: fullscreen_with_nk
// Created: 2021-11-03
// plugins
#import_plugin Nuklear as nk
// show all errors
SetErrorMode(2)
//
#option_explicit
//
#constant WINDOW_W 1024
#constant WINDOW_H 768
#constant FPS_MAX 30
#constant KEY_F4 115
// set window properties
SetWindowTitle( "fullscreen" )
SetWindowSize( WINDOW_W, WINDOW_H, 0 )
SetWindowAllowResize( 1 ) // allow the user to resize the window
// set display properties
SetVirtualResolution( WINDOW_W, WINDOW_H ) // doesn't have to match the window
SetOrientationAllowed( 1, 1, 1, 1 ) // allow both portrait and landscape on mobile devices
SetSyncRate( FPS_MAX, 0 ) // 30fps instead of 60 to save battery
SetScissor( 0,0,0,0 ) // use the maximum available screen space, no black borders
UseNewDefaultFonts( 1 ) // since version 2.0.22 we can use nicer default fonts
#insert "Nuklear.agc"
nkInit()
global flg_winfull as integer
flg_winfull = 0
CreateBgImage()
do
nk.HandleInput()
// anything nk script ...
//Print( ScreenFPS() )
Print("Press F4 key.")
ToogleWindowSize()
nkSync()
loop
function ToogleWindowSize()
if GetRawKeyReleased(KEY_F4)
if flg_winfull = 0
flg_winfull = 1
SetWindowSize(WINDOW_W, WINDOW_H, 1)
else
flg_winfull = 0
SetWindowSize(WINDOW_W, WINDOW_H, 0)
endif
endif
endfunction
function CreateBgImage()
cr as integer
cr = MakeColor(0, 0, 255)
DrawBox(0, 0, WINDOW_W, WINDOW_H, cr, cr, cr, cr, 1)
Render()
GetImage(1, 0, 0, WINDOW_W, WINDOW_H)
CreateSprite(1, 1)
SetSpritePosition(1, 0, 0)
endfunction