new_point
The new_point function is a non-class version of the CPoint:new method which creates and returns a new CPoint object.
P = new_point() P = new_point( x0 ) P = new_point( x0, y0 ) P = new_point( CPoint_old ) P = new_point( CRect_old ) P = new_point( tbl ) WIth no parameters, this method creates a CPoint object, assigns x=0 and y=0, and returns the new object. x0 is a single number for initializing both the x and y class members. y0 is the second number, which initializes the class x and y to x0 and y0. CPoint_old is an existing CPoint object. CRect_old is an existing CRect object. The class member x is inialized to the rectangle width and y is initialized to the rectangle height. tbl is a 1-dimensional array with 2 numeric members at index 1 and index 2. The class x is initialized to tbl[1] and y is initalized to tbl[2]. P is returned as a new instance of the CPoint class. On failure, nil is returned. |
The following script creates various CPoint objects.
|
-- create a CPoint object |
|
-- set the values for point members x and y |
|
-- create a CPoint object with intial values |
|
-- create a new rectangle object |
|
-- add the rectangle width and height to P1 and add 2 |
Mira Pro x64 Script User's Guide, Copyright Ⓒ 2023 Mirametrics,
Inc. All Rights Reserved.