Adding New Class/file using Visual Studio 2012 cocos2d-x

Hi. I just finished setting up new project of cocos2d-x 3.2 using python Script. Then I opened up the solution with VS2012.
However when I try to create new cpp file using class(add->classes) new wizard, it always goes under the directory of “proj.win32”, not “classes” folder where HollowWorldScene and other files are located.

I also want to manage my files by creating folders and put them by different categories but I face same issue like it creates folder under “proj.win32” , not under “classes”.

I am aware of the face that you can use “add new Item” but it does not allow me to create folder.

Please help!. I am really curious If i am the only one who’s suffering this issue, since I can’t find any single information regarding this issue.

Hey.

Create the new cpp file inside the filesystem and drag n drop it inside VS :smiley: That’s what I am doing all the time. I never tried to create it with VS.

while creating new .h / .cpp file it will ask you the folder path. Look into the dialog carefully.

1 Like

that’s the technique i have been using up to this point. unfortunately, it’s an extra step.

ideally, it would be nice to add a new class via: Project -> Add Class… menu item, and then input the desired path ( \Project\Classes in this case ). however, the Location field is disabled (grayed out) and defaulted to \Project\proj.win32. creating classes here doesn’t seem to break anything until you try to reload the project on a different platform (ex: linux or mac) using a different IDE.

any thoughts or ideas on how to add classes this way and still designate the desired path?

The dialog after the Add Class dialog will have two fields, “.h file” and “.cpp” file

The Add Class dialog for C++ is always going to disable Location.

You will fill in the location of the two files in the next dialog.