(4) Basic workflow (export data)

Source: Internet
Author: User

When using Cocos Studio to edit a good resource, we want to use it in the engine, and we need to publish it. Because the Cocos Studio project file uses XML data format for storage and saves some extra data that only the editor needs, if the user loads the project file directly using Cocos2d-x and COCOS2D-JS, the project file is not only large and slow to load, So we need a release that, during the publishing process, the editor removes some of the extraneous information from the project file, and converts the XML format to Flatbuffers and JSON, which are used in the C + +, Lua, and JS languages to be the least capacity, the fastest, Next, we'll show you how to publish resources:

1) Open Our Hellococos, choose the Publish Button "", click on the release, the resources are released.

2) Click "Publish and Pack ... ", the release and packaging interface will pop up, such as:

        

3) Publish resources: Perform the publish resource process.

Publish as Visual Studio project: On Windows only, perform the publish resource process first, and then open the project by using Visual Studio.

Publish as a Xcode project: on a Mac only, perform the publish resource process first, and then open the project using Xcode.

4) Click on Settings, Popup "menu: Project--Project Settings ... "Interface, such as:

5) post content :

1. Publish Resources and Project files: Copy the resources used by the editor to the publishing path and publish the Csd,csi file as the resource used by the cocos2d-x. Note: When the resources are high, the copy speed is slow, and it is recommended to publish only the project file.

2. Publish only project files: Publish only the Csd,csi file as the resource used by Cocos 2d-x.

  Publishing Path : You can customize the publishing path of a resource, which supports absolute and relative paths.

  Data Format :

1, CSB: Using flatbuffers output binary, high resolution efficiency, small size, good security performance, applicable to C + + and LUA projects.

2. Json: Lightweight data Interchange Format, readable, JavaScript native support, for JS project.

3, Lua: readable, suitable for cocos2d-x luabinding project.

4, Custom: Refer to the following

1. Custom Data export format

Cocos Studio supports three export formats by default: CSB, Json, Lua. Users may choose the format they want to export, if there are special needs, can be self-guided, the corresponding reading part of the need to implement their own. Just implement the Cocos Studio.Projects.IGameProjectSerializer interface (after the Cocos v2.3.3 version Cocos Studio.Projects.IGameFileSerializer , whichever is the actual code.) See the class in the catalog in the example Project PublishExtend CustomSerializer ). The interface is defined as follows:

[typeextensionpoint]//after Cocos v2.3.3 version for Igamefileserializerpublic interface igameprojectserializer{//<summary    >//Serializer ID///</summary> string ID {get;}    <summary>///external display name///</summary> string Label {get;} <summary>///execute serialization///</summary>//<param name= "info" > Publish setup Information </param>//<p Aram Name= "Projfile" > Project file, after Cocos v2.3.3 This parameter is gamefile gamefile</param>//<returns> error message (empty at normal end) &lt    ;/returns> string Serialize (publishinfo info, iprojectfile projfile);    <summary>///perform context initialization operations.    A Studio solution is called only once and is called before the first Serialize call.    Note: Each *.CSD file is called once Serialize.    </summary> void Contextinitialize (Publishinfo publishinfo);    <summary>///execute context end operation.    A Studio solution is called only once and is called after the last Serialize call.    Note: Each *.CSD file is called once Serialize. </summary> void Contextfinalize (Publishinfo pubLishinfo); }

See the example project for other parts.

The user can now convert the CSD file (ie: Cocos studio's project file) to the format it needs.

2. Other

The content of the document is continuously updated based on feedback during the subsequent development process. If updates are available, please refer to the new version.

If you have any comments or suggestions for the Cocos Studio extension, please give us feedback on the forum or the developer community. Thank you for your attention and support for Cocos Studio, we will return you to better use of the product.

(4) Basic workflow (export data)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.