- CGPoint (x,y)
- CGSize (width, height)
- CGRect (origin + size, or CGPoint + CGSize)
Note the origin point is the upper-left hand corner (0,0)
X positive goes to the right
Y positive goes down
Creating CG objects:
CGPoint point = CGPointMake(50.0,100.0);
point.x = 50.0
point.y = 100.0
CGSize size = CGSizeMake(23.0,42.0);
size.width = 23.0;
size.height = 42.0;
CGRect rect = CGRectMake( x, y, width, height);
rect.origin.x = x1;
rect.origin.y = y1;
rect.size.width = w1;
rect.size.height = h1;
No comments:
Post a Comment