touched the srceen,cclayer class did't call ccTouchsBegan method,only called ccTouchesMoved and ccTouchesEnded method!

environment:cocos2d-x in win32.

follow the source code:

#include “HelloWorldScene.h”

using namespace cocos2d;

#define PTM_RATIO 32
CCScene* HelloWorld::scene()
{
CCScene * scene = NULL;
do
{
// ‘scene’ is an autorelease object
scene = CCScene::node();
CC_BREAK_IF(! scene);

// ‘layer’ is an autorelease object
HelloWorld **layer = HelloWorld::node;
CC_BREAK_IF;
layer~~>setIsTouchEnabled;
//this~~>setIsTouchEnabled;
// add layer as a child to scene
scene~~>addChild;
} while ;
// return the scene
return scene;
}
// on “init” you need to initialize your instance
bool HelloWorld::init
{
cocos2d::CCLog;
bool bRet = false;
do
{
//////////////////////////////////////////////////////////////////////////
// super init first
//////////////////////////////////////////////////////////////////////////
CC_BREAK_IF);
CCSprite ball=CCSprite::spriteWithFile);
ball~~>setPosition);
ball~~>setTag;
this~~>addChild;
b2Vec2 gravity=b2Vec2;
this~~>world=new b2World;
b2BodyDef containerBodyDef;
containerBodyDef.position.Set;
this~~>containerBoby=this~~>world~~>CreateBody;
cocos2d::CCSize screenSize=cocos2d::CCDirector::sharedDirector~~>getWinSize;
//upper left corner
cocos2d::CCPoint ulcp=ccp;
b2Vec2 upperLeftCorner=HelloWorld::toMeters;
//upper right corner
cocos2d::CCPoint urcp=ccp;
b2Vec2 upperRightCorner=HelloWorld::toMeters;
//lower left corner
cocos2d::CCPoint llcp=ccp;
b2Vec2 lowerLeftCorner=HelloWorld::toMeters;
//lower right corner
cocos2d::CCPoint lrcp=ccp;
b2Vec2 lowerRightCorner=HelloWorld::toMeters;
b2PolygonShape screenBoxShap;
int density=0;
//top
screenBoxShap.SetAsEdge;
this~~>containerBoby~~>CreateFixture;
//left
screenBoxShap.SetAsEdge;
this~~>containerBoby~~>CreateFixture;
//bottom
screenBoxShap.SetAsEdge;
this~~>containerBoby~~>CreateFixture;
//right
screenBoxShap.SetAsEdge;
this~~>containerBoby~~>CreateFixture;
b2BodyDef ballBodyDef;
ballBodyDef.type=b2_dynamicBody;
ballBodyDef.position=HelloWorld::toMeters);
ballBodyDef.userData=ball;
this~~>ballBody=this~~>world~~>CreateBody;
//define a box shape and assign it to the body fixture
b2CircleShape circle;
circle.m_radius=26.0/PTM_RATIO;
b2FixtureDef ballShapeDef;
ballShapeDef.shape=&circle;
ballShapeDef.density=1.0f;
ballShapeDef.friction=0.0f;
ballShapeDef.restitution=1.0f;
this~~>ballBody~~>CreateFixture;
b2Vec2 force=b2Vec2;
ballBody~~>ApplyLinearImpulse;
//定义滑板
CCSprite
paddle=CCSprite::spriteWithFile;
ball~~>setPosition);
ball~~>setTag;
this~~>addChild;
b2BodyDef paddleBodyDef;
paddleBodyDef.type=b2_dynamicBody;
paddleBodyDef.position=HelloWorld::toMeters);
paddleBodyDef.userData=paddle;
this~~>paddleBody=this~~>world~~>CreateBody;
b2PolygonShape paddleShape;
b2Vec2 shapeposition=HelloWorld::toMeters.width/2,paddle~~>getContentSize.height/2));
paddleShape.SetAsBox;
b2FixtureDef paddleShapeDef;
paddleShapeDef.shape=&paddleShape;
paddleShapeDef.density=10.0f;
paddleShapeDef.friction=0.4f;
paddleShapeDef.restitution=0.1f;
this~~>paddleFixture=this~~>paddleBody~~>CreateFixture;

this~~>schedule);
bRet = true;
} while ;
return bRet;
}
void HelloWorld::menuCloseCallback
{
// “close” menu item clicked
CCDirector::sharedDirector~~>end;
}

void HelloWorld::tick {
this~~>world~~>Step;
for; b; b=b~~>GetNext) {
if != NULL) {
cocos2d::CCSprite**sprite = (cocos2d::CCSprite )b~~>GetUserData;
sprite~~>setPosition));
sprite~~>setRotation));
/*b2Vec2 b2Position = b2Vec2.x/PTM_RATIO,
sprite~~>getPosition.y/PTM_RATIO);
float32 b2Angle = 1 * CC_DEGREES_TO_RADIANS);
b
>SetTransform;
/
}
}
}

b2Vec2 HelloWorld::toMeters(cocos2d::CCPoint point)
{
return b2Vec2(point.x/PTM_RATIO,point.y/PTM_RATIO);
}

cocos2d::CCPoint HelloWorld::toPixels(b2Vec2 vec)
{
return ccpMult(ccp(vec.x,vec.y),PTM_RATIO);
}

void HelloWorld::ccTouchsBegan(cocos2d::CCSet pTouchs,cocos2d::CCEventpEvent)
{
cocos2d::CCLog(“—————ccTouchsBegan————”);
//if(this~~>mouseJoint!=NULL) retu
/*if return;
CCTouch **pTouch=pTouchs~~>anyObject;
cocos2d::CCPoint location=pTouch~~>locationInView);
location=cocos2d::CCDirector::sharedDirector~~>convertToGL;
b2Vec2 locationWorld=HelloWorld::toMeters;
if){
b2MouseJointDef md;
md.bodyA=this~~>containerBoby;
md.bodyB=this~~>paddleBody;
//this~~>paddleBody~~>SetAwake
md.target=locationWorld;
md.collideConnected=true;
md.maxForce=1000.0f*this~~>paddleBody~~>GetMass;
this~~>mouseJoint=this~~>world~~>CreateJoint;
this~~>paddleBody~~>SetAwake;
}*/
}

bool HelloWorld::ccTouchBegan
{
cocos2d::CCLog;
/*if{
return true;
}*/
return true;
}
void HelloWorld::ccTouchesMoved
{
cocos2d::CCLog;
//if retu
/*if return;
CCTouch**pTouch=pTouchs~~>anyObject();
cocos2d::CCPoint location=pTouch~~>locationInView);
location=cocos2d::CCDirector::sharedDirector~~>convertToGL;
b2Vec2 locationWorld=HelloWorld::toMeters;
this~~>mouseJoint~~>SetTarget(locationWorld);*/
}

void HelloWorld::ccTouchesCancelled(cocos2d::CCSet pTouchs,cocos2d::CCEventpEvent)
{
cocos2d::CCLog(“—————ccTouchesCancelled————”);
/*if(this~~>mouseJoint!=NULL){
//cocos2d::CCLog;
cocos2d::CCLog;
this~~>world~~>DestroyJoint;
this~~>mouseJoint=NULL;
}*/
}

void HelloWorld::ccTouchesEnded(cocos2d::CCSet pTouchs,cocos2d::CCEventpEvent)
{
cocos2d::CCLog(“—————ccTouchesEnded————”);
/*if(this~~>mouseJoint!=NULL){
cocos2d::CCLog;
this~~>world~~>DestroyJoint;
this~~>mouseJoint=NULL;
}*/
}

Oh, it is ccTouchesBegan, not ccTouchsBegan.

i don’t get it,can you speak more detail?

oh,my god,3Q

The function name is error, lost “e” before “s”.

i get it,thanks