本文介绍了CGPointMake需要解释吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

谁能向我解释一下 CGPointMake 是做什么的?

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

推荐答案

这是一个内联函数,用您传入的值填充 CGPoint 结构.

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

Command-双击代码中的 CGPointMake,您将被带到显示函数的标题:

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;
}

这篇关于CGPointMake需要解释吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-14 13:53