joseph.howell Posted March 21, 2016 Share Posted March 21, 2016 Hi, is it possible to set window size through code? This forum thread indicates that we should use App::setVideoMode https://developer.unigine.com/forum/topic/3550-how-to-manipulate-app-window-size/?hl=window+size#entry18743 But that causes a crash, as indicated by this thread: https://developer.unigine.com/forum/topic/2181-solved-set-video-mode-fatal-error/?hl=setVideoMode#entry11925 The second thread indicates we should do this through the console. However, I've used video_height, video_width, and video_mode console commands, and none of them do anything. In the attached screen capture, you can see me trying out different modes, and yet the screen is still 1600x900. Help, please? Link to comment
joseph.howell Posted March 21, 2016 Author Share Posted March 21, 2016 Ok, I see I need to execute the video_restart command after any of those other commands. But is there a way I can just set the initial video resolution without having to restart? Link to comment
paralyzah Posted March 22, 2016 Share Posted March 22, 2016 Hello JosephYou can set custom videomode with console commands.video_mode must be established to "-1" (see documentation - https://developer.unigine.com/en/docs/2.2/code/command_linein "Video settings chapter") Also, set parameter "video_resizable" to "off"For example, your console command could be next:video_mode -1 && video_resizable 0 && video_width 300 && video_height 300 && video_restart (see attached screenshot)What about methods App:: setVideoMode / restoreVideoMode:* if you want change video-mode then you can't use it ,* if you make your custom App (using inheritance of AppClass) then you can override this methods - we will add notices in our documentationSorry for inconvenience caused. Link to comment
joseph.howell Posted March 22, 2016 Author Share Posted March 22, 2016 I do want the window to be resizable though still. Link to comment
joseph.howell Posted March 22, 2016 Author Share Posted March 22, 2016 Using the console commands just doesn't work very well for me. I mean, I can get the window to resize, but I have to restart the window, which isn't ideal. However, I discovered the command-line parameters for setting the video mode, and that seems to work just fine for me. Thanks Link to comment
Recommended Posts