I created a project in visual studio. Further wrote the code. Now I'm interested in which project folder to upload images with sprites.

  • To the Resources folder (did you hope to create a project blank via cocos.py?) - Vladimir Gamalyan
  • No, the pig did not create. Tell me how to do it. - Anna13

2 answers 2

Hello.

Procedure:

  1. In the folder "Recources" throw your pictures;
  2. Then in the project Add->Existing Item ;
  3. Go to the folder "Recources" select the desired images.

    create a frame through the console: cocos new NAMEyourGAME -p com.YOURWEBSITE.NAMEyourGAME -l cpp -d ./FOLDERFORYOURPROJECTS/ then go to the folder with the frame, the cmake command and see the compilation options.

    The default images are in the Resources folder, but it's better to take care of the multiscreen right away and create folders for different permissions, register them in AppDelegate.cpp to bind to these folders

       
       auto fileUtils = FileUtils :: getInstance ();
       auto screenSize = glview-> getFrameSize ();
       std :: vector resDirOrders;
       if (screenSize.width == 2048 || screenSize.height == 2048)
         {
           glview -> setDesignResolutionSize (1536, 2048, ResolutionPolicy :: NO_BORDER);
           resDirOrders.push_back ("ipadhd");
           resDirOrders.push_back ("ipad");
           resDirOrders.push_back ("iphonehd5");
           resDirOrders.push_back ("iphonehd");
           resDirOrders.push_back ("iphone");
         }
       else if (screenSize.width == 1024 || screenSize.height == 1024)
         {
           glview -> setDesignResolutionSize (768, 1024, ResolutionPolicy :: NO_BORDER);
           resDirOrders.push_back ("ipad");
           resDirOrders.push_back ("iphonehd5");
           resDirOrders.push_back ("iphonehd");
           resDirOrders.push_back ("iphone");     
         }
       else if (screenSize.width == 1136 || screenSize.height == 1136)
         {
           glview -> setDesignResolutionSize (640, 1136, ResolutionPolicy :: NO_BORDER);
           resDirOrders.push_back ("iphonehd5");
           resDirOrders.push_back ("iphonehd");
           resDirOrders.push_back ("iphone");
    
         }
     else if (screenSize.width == 960 || screenSize.height == 960)
         {
           glview -> setDesignResolutionSize (640, 960, ResolutionPolicy :: NO_BORDER);
           resDirOrders.push_back ("iphonehd");
           resDirOrders.push_back ("iphone");
         }
       else
         {
           resDirOrders.push_back ("iphone");
           glview -> setDesignResolutionSize (320, 480, ResolutionPolicy :: NO_BORDER);
         }
    
       fileUtils-> setSearchPaths (resDirOrders); 
       // Load your first scene
       auto scene = MainMenu :: createScene ();