The config.json file is used for project configuration initialization and is configured before the program is run.
The following is an example of the config.json file of the cocos2d-x lua project:
{
"init_cfg":{
" isLandscape": true,
"isWindowTop": false,
"name": "CocosLuaGame",
"width": 960,
"height": 640,
"entry": "src/main.lua",
"consolePort": 6010,
"uploadPort ": 6020,
"debugPort": 10000,
"forwardConsolePort": 10089,
"forwardUploadPort": 10091
} ,
"simulator_screen_size": [
{
"title": "iPhone 3Gs (480x320)",
"width" : 480,
"height": 320
},
{
"title": "iPhone 4 (960x640)" ,
"width": 960,
"height": 640
},
....
]
}
The detailed explanation is as follows:
"init_cfg"
"isLandscape"
Boolean type
Horizontal and vertical screen configuration, if true, it will be horizontal screen, if it is false, it will be vertical screen
"isWindowTop"
Boolean type
< p>Window top configuration, if true, the window will be on top by default, otherwise it will not be on top by default"entry"
String type
Script startup entry file is relative The file path of the project root directory, such as: "src/main.lua"
"name"
String type
The project name is displayed in the window title Medium
Note: This parameter only takes effect in desktop systems
"width"
Positive integer
Window width
Note: This parameter only takes effect in desktop systems
"height"
Positive integer
Window height
Note: This parameter only takes effect in desktop systems
"consolePort"
Positive integer
console port
"uploadPort"< /p>
Positive integer
Port for receiving files uploaded by IDE
"debugPort"
Positive integer
Debug port
"forwardConsolePort""
Positive shaping
When debugging in Android ADB mode, map this port to the consolePort of the Android device
"forwardUploadPort""
Positive shaping
When debugging in Android ADB mode, map this port to the uploadPort of the Android device
Note: All port configurations They only take effect on desktop platforms.