Hi,
I create a game for ios and now I run it on mac os, it works perfectly, but I want to allow the user to resize the game screen on mac, but I have no idea how i can do that.
Any help will be appreciated.
You mean the actual window that is created right?
Yes, the window create by the mac app, I use a fixed resolution in cocos2d-x screen with the ExactFitResolution with a fixed value of 960x640 px.
But I want to enable the user control the aspect ratio of the mac screen.
Unfortunately, this not work for me, and broke my project.
I create another one, but I change the AppController.mm inside mac folder.
I change the following line
NSRect rect = NSMakeRect(200, 200, 480, 320);
to
NSRect rect = NSMakeRect(200, 200, 960, 640);
The screen is not resizable yet, but at least is bigger now.
I dont know if this will help, but: https://developer.apple.com/library/mac/documentation/Cocoa/Reference/ApplicationKit/Classes/NSWindow_Class/Reference/Reference.html
Look at the “Sizing Windows” and “Sizing Content” sections. It looks like there are some functions to handle what you want.
Thanks for help Jason, I can get full screen by using the link below
stackoverflow.com/questions/4982656
oh, you asked about “re-sizing”, not making it full screen. Sort of wasted my time trying to help you
I try to resize it, but it not work for me, when I resize the screen, my game still not changed the screen size, because that the only solution is to create the game full screen