The Cocos2d-x Programmers Guide

I’ll be adding these after I complete the final draft for Chapter 12 (next week)

Very fun! Thank you very much!!
In Chapter 3, Could you give a bit more detail about how loading a SpriteSheet works?

// this is equivalent to the previous example,
// but it is created by retrieving the spriteframe from the cache.
auto newspriteFrame = SpriteFrameCache::getInstance()->getSpriteFrameByName("mysprite.png");
auto newSprite = Sprite::createWithSpriteFrame(newspriteFrame);

I’m assuming that there’s some sort of function that would allow you to “crop” or “select” an area for a frame?
Could you show us how to grab multiple frames?

I’ve found an example on an old post here, but I’m not sure if this is how it generally works.

When you load a sprite sheet it has 2 files. One that contains the images and a second, a .plist, that contains info that describes the Sprite and its size in a Rect. The engine interprets this and when you ask for mySprite.png it knows what to return, its size, etc. You can look at the .plist in any text editor or Xcode.

OK.
I will as soon as I get a chance. Thank you.

Please include a section for the log method in the new Programmer’s Guide. The replacement for the deprecated CCLOG and CCLog is log. This follows the pattern of stripping away the CC prefix in the migration to 3.x, but all of the old documentation and tutorials I’ve encountered use either of the 2 older methods.

Note: the migration guide includes a command to reinstate CCLOG after the CC prefix has been removed by an earlier command: http://www.cocos2d-x.org/wiki/User_Tutorial-CPP_Migration_from_v2_2_*_to_v3_0

CCLog is still referenced in the new docs once (2 other examples use the appropriate current log method): http://slackmoehrle.github.io/H/

Thanks for mentioning this.

Chapter 9, 3D, is alive!

http://www.cocos2d-x.org/programmersguide/9/

2 Likes

A couple of weeks ago we released an API guide for Cocos2d-x and Cocos2d-JS completely free covering many features from every action with video examples to 3D.

Yes and your guide is all of the content we are adding to the Programmers Guide, some language changed. You literally have taken my work and changed the graphics and some wording.

This is confusing to the users to have documentation in multiple places. I feel like the defeats the purpose of a united community.

I like the some of the graphics you have used to explain concepts (specifically the 3D chapter). Perhaps a better way to approach this is if we incorporate the graphics you have (provided there is permission from the source to use them) into the guide via pull requests.

1 Like

Well it’s not the same. I won’t lie that I took inspiration from your guide, I did but it’s code that is a few lines so will have huge similarities. Besides we started a while back when yours was in it’s early stages. Regarding a unified community we made this for the same reasons we made our videos because it was long over due. Considering ours is finished and yours still have many chapters left theres no way we copied the entire thing at the very least. The main thing we took from yours as I don’t wanna lie is the sections and the order apart from that it was more us.

Not trying to start a pissing match here just stating the facts.

Regarding working together on this. You have our email so feel free to contact us.

We started this guide in August. The first post in this topic was September 14. Your “version” has come out after we started releasing chapters officially, in 90% the same format, same wording, etc. For the code you replaced our use of auto. The 3D chapter is so similar it isn’t “inspiration” its plain outright copying.

The fact of the matter is we do things in an open-sourced venue. We give away our work for the benefit of everyone that wants to use it. If our Programmers Guide helps you build a learning site that you think you need to help users then so be it. Perhaps some users will fond your site easier for them to learn. I can’t stop that. I don’t have to be happy about it though. If anything it just motivates me more to continue the work that is going into our version. If you have pull requests you would like to submit then you are welcome to do so. They are always welcome and appreciated.

1 Like

Well there is very little documentation so we have to learn how to use it from somewhere and then create resources.

We created it because Chukong doesn’t have the best resources so we did videos then this.

I don’t see a problem. Your more than welcome to take stuff from ours.

We know the documentation is lacking, that is why we are creating the Programmers Guide, why we upgraded the forums, why we have developers writing code and also submitting documentation for the Programmers Guide at the same time.

Your videos have been around for a long time and we appreciate those. I have watched a number of them. I find them useful and informative. Kudos. You contributed these and there was a clear gap and need. Our users references your videos a lot. This was a great void to fill.

But you can’t say there is very little documentation so you have to learn and create it when you copied what I was already working on and are trying to pass it off as superior to our official guide. This is what doesn’t make sense to me.

1 Like

Videos are fine, but static. Why not make some interactive programming guide?

It would be more awesome to have an interactive code terminal, where you can try out the original code and even modify it. This way you see direct outcomes of the changes.
The tricky part would be to build some C++ parser that drives the JS/html5 version of the engine.

@slackmoehrle Regarding your “copying” claims, just take it this way: they forked your programming guide :wink:

1 Like

We are not saying it is superior just another guide. Developers can use what they want. If you want we can put a reference to your guide in it.

An interactive editor is something we want to add to Sonarlearning.co.uk eventually. It’s in the pipelines.

Regarding format, we started it before you did the redesign to make it look better.

@SonarSystems I think the problem is that you postet it directly in the thread which is for the cocos2d-x programmers guide from @slackmoehrle. He is doing a great job and you are also doing a lot for the community. I am not the fan of your videotutorials but I know that a lof of ppl like them. But I hope you can see that it looks like that you want to show to all ppl who are reading this thread “hey, look, we have something similiar but it’s a C++ and JS and it’s already finished.”.

If I am right there was a similar problem in the past where someone wrote a guide and you started to write in his thread about your guides. That’s not very nice. I think @slackmoehrle isn’t thinking that you are bad or something like that. I think it’s just that a “gentleman” would not do something like that and it could be interpreted wrong.

And now! HUG :stuck_out_tongue_winking_eye:

@SonarSystems
@slackmoehrle

I think there isn’t worth in showing what each of us did in the decent manner.

Cocos and people working for it should be a united community. And it is always better to work together rather than making the same content which actually slows down the speed of moving forward… Obviously, putting separate efforts for achieving the same things is gonna slow down things…

And, I am recent user of cocos2d-x.
I found @SonarSystems videos to be very useful but for guide, I’ve to say that majority of the portion is same as that of what @slackmoehrle has been doing .
So you end up doing the almost similar thing. Instead you could have worked on advanced topics and merged the guide and provided it to all of us at your portal, which would have been much more praiseworthy then finding the similar content at both places.
I understand the effort in creating such an enormous guide although it covers beginner’s purpose only.
But still it requires lot and lot of time.
So you could have pull request and suggested better thing to @slackmoehrle and you could have continued working on advanced topics.

This way you could have given credit to @slackmoehrle (or cocos community) and your credit of advanced topics would be obviously integral part.

Like @slackmoehrle keeps us notifying by creating a separate thread, you could also create do the same and ask people what they need and what you could provide.
It would have accelerated the net progress.
Isn’t it?
Or otherwise, you can notify @slackmoehrle personally about the topics to be covered from your side on advanced topics with deadlines so that he does not cover the same things in the time to come.

I’ve not purpose of offending anyone.
But since this conversation was going on upon the originality of the content, that is why I had to put some of my views which I hope and request not to be taken personally but in the benefit of the community.

@SonarSytems, you do a good job but what you’ve covered in the videos, you have covered almost the same things in your guide too. You should be covered advanced topics like advanced actions which are available in cocos API. But you covered the same things.
Now, we have cocos guide, your guide, your video, telling the exactly same things… which is actually not worthy.

And no offence towards both the sides(Community and SonarSystems).
I beg a pardon for interfering.

Thanks :slight_smile:

1 Like

Fair point. We offering this as part of out educational eco system so we can add and update it as we desire without having to wait.

Regarding your point about the written vs videos, I prefer videos but many community members wanted the videos content in written format hence the guide.

We will be doing advanced topics just not yet as we do all educational material not just Cocos.