What does ccp mean in Cocos2d / Objective-C?

I continue to see this phrase:

//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); 

So what does ccp mean? Is this the property of CCParallax?

+6
source share
5 answers

As Stephen said, this is just a macro for CGPointMake (x, y), but if you especially mean what “ccp” means to him, most likely c o c os2d p oint

+12
source

Are you using Cocos2D? If so, ccp is just a C macro to create a point. How in:

 #define ccp(__X__,__Y__) CGPointMake(__X__,__Y__) 
+8
source

This is just a convenience constructor for the CGPoint type.

Pretty sure it's just a macro for CGPointMake, but don't quote me on this.

+1
source

This is a shorthand macro that maps to CGPointMake (x, y).

Basically, this is a way to create CGPoints with less typing.

+1
source

There is no difference except CGPointMake is more difficult to enter:

 #define ccp(__X__, __Y__) CGPointMake(__X__,__Y__) 

Found here:

http://www.cocos2d-iphone.org/api-ref/0.99.3/_c_g_point_extension_8h_source.html

+1
source

Source: https://habr.com/ru/post/905958/


All Articles