CPoint:Class Description
The CPoint class provides a point object consisting of two properties: x, and y. Many class work with CPoint objects to keep x,y values together so as for simply the notation used in your scripts. You also can use the CPoint class to hold 2 arbitrary numbers which can be processed together using the class methods and operators.
Construction |
Object = NewPoint() (global function with several overloads) Object = CPoint:new() (class method with several overloads) |
Destruction |
Object:delete() |
These properties specify the point coordinate limits of the CPoint object. You can set them directly or by using several methods.
Global function that creates a new CPoint object. |
|
Creates a new CPoint object. Same as NewPoint. |
|
Deletes the instance of the CPoint object. |
The CPoint class contains numerous math operators so you can use CPoint objects in expressions, like P=(P1+P2)/2. These are described on the CPoint Operators page.
In addition to using the properties by name, like P.x, the methods below allow you to set or get all the properties in one operation.
Returns the x and y values of the point. |
|
Sets the x and y values of the point. |
Rounds point values up to the next higher integer value. |
|
Rounds point values down to the next lower integer value. |
|
Offsets a point's values; same as adding the points. |
|
Rounds the point values to the nearest integer value. |