Sunday, October 23, 2022
HomeGame DevelopmentStage Knowledge Query(s) - Cocos Creator

Stage Knowledge Query(s) – Cocos Creator


Hello there. I’m utilizing v2.x of Cocos Creator. I used to be questioning about easy methods to save stage information (format, x and y positions, and many others.) with out utilizing tilemap like in this submit. For the nodes whose format I’d be saving, I’d additionally want to connect parts to them. Initially, I created a brand new scene for each stage however that appears very inefficient. I’m not fairly certain easy methods to learn textual content recordsdata on startup and whereas threaded, which was beneficial within the thread I linked. Additionally, what’s the easiest way to put in writing out every node and its particulars to a file as slackmoehrle mentioned? Code examples could be appreciated.


You need to use cc.sources.load to load the textual content:
https://docs.cocos.com/creator/2.4/handbook/en/asset-workflow/textual content.html

You need to use ‘jsb.fileUtils.writeStringToFile’ to put in writing to a file.

I used to be questioning if writing out every node kind’s particulars to a file manually beforehand and utilizing module.exports so a stage constructing script (containing the extent information saved in a vector) can entry the nodes is the most suitable choice. Like in @slackmoehrle’s instance, every letter or quantity would characterize a distinct node kind.

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

- Advertisment -
Google search engine

Most Popular

Recent Comments