CPoint:Offset
The Offset method moves a point to new coordinates. The offset can be specified in several different ways and can be positive or negative. The + Operator gives similar results.
CPoint:Offset( CPoint2 ) CPoint:Offset( x ) CPoint:Offset( x, y ) where CPoint2 is another CPoint object. x is a single offset applied to both values. x and y are offsets applied individually to the CPoint values. |
The following script moves and resizes the CPoint P using various argument lists. Note that CPoint:Get returns 2 arguments, which can be automatically filled into the 2 fields of the Printf function if located as the right-most item in the Printf argument list.
|
-- create a CPoint object P |
|
-- result: 100 200. |
|
|
|
-- move and resize the point P |
|
-- result: 102 210 |
|
|
|
-- resize the point P |
|
-- result: 102 240 |
|
|
|
-- move the point P |
|
-- result: 202 340 |
|
|
|
-- move the point P |
|
-- result: 212 350 |
|
|
|
-- create another CPoint object |
|
-- resize P using another point |
|
-- result: 212 410 |