'ccp'在Cocos2d/Objective-C中表示什么?

GPP*_*GPP 6 objective-c cocos2d-iphone

我一直看到这样一句话:

//Example one
CGPoint backgroundScrollVel = ccp(-1000, 0);

//Another Example
// 3) Determine relative movement speeds for space dust and background
CGPoint dustSpeed = ccp(0.1, 0.1);
CGPoint bgSpeed = ccp(0.05, 0.05);
Run Code Online (Sandbox Code Playgroud)

那么ccp意味着什么?它是CCParallax的财产吗?

Rob*_*Rob 12

像斯蒂芬说,它只是CGPointMake(X,Y)宏,但如果你特别吝啬什么是"中国共产党"代表这是最有可能的ç Ø Ç os2d p oint


Ste*_*ert 8

你在使用Cocos2D吗?如果是这样,ccp只是一个C宏来创建一个点.如:

#define ccp(__X__,__Y__) CGPointMake(__X__,__Y__) 
Run Code Online (Sandbox Code Playgroud)