Extending the Preferences Panel

    For project-related configurations, please review the Project Settings documentation.

    The Preferences panel can be opened via the top menu Cocos Creator -> Preferences.

    The Preferences panel is divided into left and right sides.

    • On the right side is an action panel rendered according to the configuration.

    Changes made in the panel are immediately modified to the corresponding configuration items.

    Also, there are some configurations that cannot switch between global and local storage location, such as preview scenes, which must be stored in the project. This part of the configuration should use the custom panel.

    For more information about the Preferences panel, please refer to the documentation.

    Preferences allow to display configurations in two ways.

    1. Lab configuration

    General settings are displayed directly as tabs, while lab switches are displayed centrally in a separate tab.

    • When the functionality provided by the extension is more stable it is recommended to place the configuration data within the generic functionality.
    • When the functionality provided by the extension is in the development stage, it is recommended that the switch configuration data of the functionality be placed in the lab configuration.

    For details on how to define a profile, please review the Profile documentation.

    package.json

    Two editor configurations, foo and , have been defined and added the configurations to the preferences.

    • The bar is stored in the laboratory profile.

    The defined data will be automatically registered to default. Using Editor.Profile.getConfig will get the default values.

    The contributions of package.json need to be defined like the following: