visual studio - cocos2d-x 3.x on Windows: How do I change the size of my game window? -
when developing using cocos2d-x 3.x device, automatically sets gl view fit device. in vs2012 on windows, creates seemingly-arbitrarily sized window. how set size of window?
my solution follows.
in appdelegate.cpp:
bool appdelegate::applicationdidfinishlaunching() { auto director = director::getinstance(); auto glview = director->getopenglview(); if(!glview) { glview = glview::create("my game"); glview->setframesize(800, 600); // or whatever director->setopenglview(glview); } ... }
in particular use case, i'm setting window sizes various resolutions , aspect ratios test layouts. i'm sharing q&a format because couldn't find straight answer anywhere.
Comments
Post a Comment