CGPointMake explanation needed?

丶灬走出姿态 提交于 2019-12-22 06:52:21

问题


could anyone explain to me what CGPointMake does please?

image.position = CGPointMake(80,200);
id go    = [MoveTo actionWithDuration:2 position:CGPointMake(190,460)];

for example this syntax above. I am not quite sure


回答1:


It's an inline function that populates a CGPoint struct with the values you pass in.

Command-double-click CGPointMake in your code and you will be taken to the header, which shows the function:

CG_INLINE CGPoint
CGPointMake(CGFloat x, CGFloat y)
{
    CGPoint p; p.x = x; p.y = y; return p;
}


来源:https://stackoverflow.com/questions/1746378/cgpointmake-explanation-needed

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!