Ambiera ForumDiscussions, Help and Support. |
|
|
|||||
|
I've created an object-oriented wrapper for the JavaScript API with some additional features. Currently the majority of API is implemented (Node, Mesh, Vertex, Index, Material, etc.) + features like setTimeout/setInterval and encodeJSON/decodeJSON. You can download it and read the documentation at https://github.com/pkorzeniewski... Please report any bugs you find and share ideas for improvements! I hope you'll find it useful :) |
||||
|
Hey, that's really cool! Seemed to have been a lot of work? |
||||
|
Not that much really, I've started writing this wrapper for a game I'm currently working on in CC and I thought why not publish it :) Btw. there're two important features missing in the CC API right now in my opinion: 1. ccbGetSceneNodeParent - there's ccbSetSceneNodeParent available so I'm wondering if there's some technical limitation for this? 2. ccbSetSceneNodeCustomProperty/ccbGetSceneNodeCustomProperty - these functions would set/get number, string and boolean values (objects can be encoded to JSON and stored as string) Would it be possible to implement these functions in next CC version? |
||||
|
Yes, ccbGetSceneNodeParent is missing, you are right. But what should be the difference between ccbSetSceneNodeProperty and ccbSetSceneNodeCustomProperty? |
||||
|
With ccbSetSceneNodeProperty we can't set custom properties, neither can we store them in the object: var n1 = ccbGetSceneNodeFromName("myNode"); |
||||
|
Ah! Ok, that makes sense. |
||||
|
Thank you. I really appreciate. |
||||
|
Great job done by you! @pk12 ... Thanks a lot.. |
||||
|
New version (1.2.0) uses now an internal nodes tree to implement .getParent() and allow storing custom data :) Example: var myFolder = ccb.node.get('myFolder'); |
||||
|
Woha :) |
||||
|
@niko: one more important thing missing in the API - getting type of given scene node, ccbGetSceneNodeProperty('Type') throws an error "Property does not exist: Type" |
||||
|
Hello, pk12. Your JavaScript API Wrapper isn't on github now. Are you willing to share it again? I downloaded a behavior called "Randomize Nodes Positions" from http://marshtownmadness.com and your wrapper is included in the zip file, but I don't know if it's the newest version. I followed the installation instructions, but I see these errors: 1. Verifying file 'action_JSAPIWrapper.js' ... action_JSAPIWrapper.js:9:ReferenceError: ccbCloneSceneNode is not defined 2. Running plugin script plugin_JSAPIWrapper.js C:\Users\owner\Documents\CopperCube\plugins\plugin_JSAPIWrapper.js:1:ReferenceError: ccbCloneSceneNode is not defined How should I fix those problems? I have a very important question about your JavaScript Wrapper: Can it be used to retrieve the current positions of Child nodes? If I use the ccbGetSceneNodeProperty() function of CopperCube to check the position of a Child node, only its starting position will be reported, even when the Parent object moves to a new position and carries the Child node with it. If a Child node starts at the "100, 0, 0" position, that's the only position that will ever be known by the engine, even when it's at a new location. Can your project retrieve the updated positions of Child nodes? Can you please show a code sample to show how it can be done? The documentation included in the zip file show a function called getPosition(), but I don't know how to use it, and I cannot test it because your project probably cannot function while the errors I showed above are still happening. |
||||
|
Did anyone capture the Apiwrapper ? https://github.com/pkorzeniewski is empty or is it totally outdated by now ? |
|