< index < 3. System layer |
===================================== |
C++ : static void TCODSystem::forceFullscreenResolution(int width, int height) C : void TCOD_sys_force_fullscreen_resolution(int width, int height) Py : sys_force_fullscreen_resolution(width, height)
Parameter | Description |
---|---|
width, height | Resolution to use when switching to fullscreen. Will use the smallest available resolution so that : resolution width >= width and resolution width >= root console width * font char width resolution width >= height and resolution height >= root console height * font char height |
C++ : TCODSystem::forceFullscreenResolution(800,600); // use 800x600 in fullscreen instead of 640x400 TCODConsole::initRoot(80,50,"",true); // 80x50 console with 8x8 char => 640x400 default resolution C : TCOD_sys_force_fullscreen_resolution(800,600); TCOD_console_init_root(80,50,"",true); Py : libtcod.sys_force_fullscreen_resolution(800,600) libtcod.console_init_root(80,50,"",True)
C++ : static void TCODSystem::getCurrentResolution(int *width, int *height) C : void TCOD_sys_get_current_resolution(int *width, int *height) Py : sys_get_current_resolution() # returns w,h
Parameter | Description |
---|---|
width, height | Contain current resolution when the function returns. |
C++ : int w,h; TCODSystem::getCurrentResolution(&w,&h); // get desktop resolution TCODConsole::initRoot(w/8,h/8,"",true); // sets the console size so that it fills the desktop with a 8x8 font C : TCOD_sys_get_current_resolution(&w,&h); TCOD_console_init_root(w/8,h/8,"",true); Py : w,h=libtcod.sys_get_current_resolution() libtcod.console_init_root(w/8,h/8,"",True)