CPoint:Set
The Set method assigns new values to the x and y members of the CPoint. This allows the CPoint values to be reset after the object is created, or you could use expressions to assign the x and y values directly.
P = CPoint:Set( x0 ) P = CPoint:Set( x0, y0 ) P = CPoint:Set( CPoint_old ) P = CPoint:Set( CRect_old ) P = CPoint:Set( tblSet ) x0 is the new value to assign both the x and y members of the CPoint. x0 and y0 are values to apply respectively to the x and y members of the CPoint. CPoint_old is another CPoint object. Its x and y members are copied to the current CPoint. CRect_old is a CRect object. Its Width and Height are computed and respectively copied to the x and y values of the CPoint. tblOffset is a 1-dimensional array. Element 1 is assigned to the x member and element 2 is assigned to the y member of the CPoint. P returned is the original CPoint object. This allows the Set method to be used as part of an operator expression, if desired. On failure, nil is returned. |
The following script creates a CPoint object and resets its values using the Set method.
|
-- create a CPoint object |
|
-- result: x=4.4, y=-12.7 |
|
-- reset the values |
|
-- result: x=4, y=-6 |
|
-- create a rectable in the method call |
|
-- result: x=1, y=3 (apply width and height) |
CPoint class, CRect class, CPoint Math Operators
Mira Pro x64 Script User's Guide, v.8.73 Copyright Ⓒ 2024
Mirametrics, Inc. All Rights Reserved.