• Runtimes
  • Cocos2D v3 - sprites not rendering, debug bones OK

I'm using Cocos2D v3.0 for my new game. But sprites are not rendering.

As far as I could tell Spine doesn't seem to support v3, so I had a go at updating it - my fork is here:

https://github.com/sarah-j-smith/spine- ... ee/cocosv3

When it didn't work in my game I created a minimal proof of the issue which uses the SpineBoy example:

https://github.com/sarah-j-smith/spine_check_2

The Cocos2D-iphone guys updated from v2.x a while ago, and at the same time bought out a new tool Sprite Builder (based on CocosBuilder). Things which make it utterly compelling for me are Android support, and the new Sprite Builder tool. There's a load of nice other things too, like ARC inside of Cocos. Going back to v2.x is not really an option for me.

Unfortunately with my hacking to date I haven't been able to get Spine animations working under v3. It runs, and I see the debug bones moving on the screen, with the SpineBoy example, but no sprites display.

Anyone seen symptoms like this before?

Related Discussions
...
  • Uređeno

There are a million reasons why things aren't rendering. 🙂

I just committed meshes for cocos2d-x, so everything should work. Run the example and click until you see goblins.

I'm actually using cocos2d-iphone - the objective c framework.

I don't think it is Spine that is the problem, as such. Its something in my attempt to adapt the Spine runtime for Cocos2D-iphone from 2.x to 3.x - something really really tiny I'm sure.

Basically here:

https://github.com/sarah-j-smith/spine- ... ton.m#L182

....in the draw, the textureAtlas is not displaying textures.

I've cross-posted on the Cocos2D-iphone forums, but the answers I'm getting are basically "the spine guys are working on it" - tho' I'm not really sure that is right. I'm guessing you have a lot of other stuff planned before updating this runtime.


OK, after a day of searching and hacking it turned out to be an issue with the way Cocos2D v3 handles colours, with respect to the alpha calculation.

I have not done a proper fix for this - at present since my spine files don't use colour tinting at all - I've just set r, g, b, and a to 255 inside RegionAttachment_updateQuad(...) as here:

https://github.com/sarah-j-smith/spine- ... hone.m#L70

This makes my spine character display in my game, and I'm too tired right now to fix it properly.

If someone wants to take what I've done and add in a proper fix for the colour calculation then you've got a Cocos v3 compatible runtime.

You're welcome. :-)

Thanks for the update, we really appreciate when people figure out how to solve a problem and then post about it 🙂 Nate will probably chime in on this soon!

I just finished cocos2d-x (to 3.1) and plan to update cocos2d in a similar way. I'm not sure why you had a problem with colors, I look forward to getting a headache figuring out cocos2d 3.x. 🙂