.ccscene files

So I created a new test project using the Composer Scene Template and the template creates 3 scenes and they all have .ccscene files which seems to be json files that depict the layout of each scene.

The question is what makes these files? Is there a visual editor?

These files are for an upcoming feature that we will announce in the blogs when it’s ready for a public beta test.

Rob

So in that example, you’re using getObjectByTag() to determine whether an object is available, but what you’re looking at is named as ID. An ID is usually something that’s unique while multiple objects can be tagged with the same thing.

I’d suggest getObjectByTag() and getObjectById() in order to differentiate between the two.

getObjectByID() would only return a single item (the first match of “id” it finds - should only be one unless coder is lazy and reusing the same ID among objects).

getObjectByTag() would return a table holding all matching “tag” items. If only one is found it’s the 1st element of that table.

Just a suggestion based on poking under the hood.

 Jay

So far I haven’t figured out a way to add properties to an object via the JSON file. If that’s not available right now, I’d like to suggest that capability be added.

While the JSON file may not be something that users “should” be poking at, by allowing multiple properties to be attached to the objects you allow 3rd parties to make tools that can work in conjunction with Corona Composer. More tools = better for everyone.

My first thought is that any JSON key that’s not “known” by Corona should be added as a property of that object. But if that’s too “wide open” then how about a JSON key like props or params – a table that allows multiple property key/values. The object could then add that single property, which could be accessed like: obj.params.foo

Although I think a case could be made to split the params out and add them all as “root” properties so you’d have obj.foo available.

 Jay

PS - I know, you haven’t asked for any kind of feedback, but really, when has that stopped me before? :slight_smile:

Can it support sheet animation sprite?

These files are for an upcoming feature that we will announce in the blogs when it’s ready for a public beta test.

Rob

So in that example, you’re using getObjectByTag() to determine whether an object is available, but what you’re looking at is named as ID. An ID is usually something that’s unique while multiple objects can be tagged with the same thing.

I’d suggest getObjectByTag() and getObjectById() in order to differentiate between the two.

getObjectByID() would only return a single item (the first match of “id” it finds - should only be one unless coder is lazy and reusing the same ID among objects).

getObjectByTag() would return a table holding all matching “tag” items. If only one is found it’s the 1st element of that table.

Just a suggestion based on poking under the hood.

 Jay

So far I haven’t figured out a way to add properties to an object via the JSON file. If that’s not available right now, I’d like to suggest that capability be added.

While the JSON file may not be something that users “should” be poking at, by allowing multiple properties to be attached to the objects you allow 3rd parties to make tools that can work in conjunction with Corona Composer. More tools = better for everyone.

My first thought is that any JSON key that’s not “known” by Corona should be added as a property of that object. But if that’s too “wide open” then how about a JSON key like props or params – a table that allows multiple property key/values. The object could then add that single property, which could be accessed like: obj.params.foo

Although I think a case could be made to split the params out and add them all as “root” properties so you’d have obj.foo available.

 Jay

PS - I know, you haven’t asked for any kind of feedback, but really, when has that stopped me before? :slight_smile:

Can it support sheet animation sprite?