CCScrollLayer is not up to date

CCScrollLayer is not up to date
0.0 0


Hi, I’m trying to use CCScrollLayer of the github and it is not up to date as I got a lot of errors like m_tContentsize undeclared and stuff like that…

What I did in my cocos2d finished game (as now I’m porting it to cocos2d-x), in my Select Level screen, I just create a CCLayer for each level, add them to the CCScrollLayer and then I have a good level selection menu

Is there any other way to do it??
Have anyone modified CCScrollLayer to work?



The errors are:

  • Use of undeclared identifier m_tContentSize
  • Use of undeclared identifier m_tPosition

I know those are (I had to do this in the .h file)
CCSize m_tContentSize;
CCPoint m_tPosition;

But how are they initialized?



im not sure but i think you have to use m_obContentSize of CCNode instead of m_tContentSize.

Good luck!


Yes, somehow CCScrollLayer.cpp is not compiling. I’m wondering how they got to work in the first place.

m_tContentSize does not exits, you need to use m_obContentSize declared as protected in CCNode
m_tPosition does not exits, the same, use m_obPosition.

There are also other problems, such as use of NSMutableSet, which is clearly iOS.