CPoint:Round
The Round method replaces the x and y members of the CPoint with the nearest integer value. For example, x=1.8 rounds up to x=2, and x=-16.8 rounds down to x=-17.
P = CPoint:Round()
|
The following script creates a CPoint object and applies the Round method to its values.
|
-- create a CPoint object |
|
-- result: x=4.4, y=-13.2 |
|
-- compute the rounded values |
|
-- result: x=4, y=-13 |
Mira Pro x64 Script User's Guide, v.8.75 Copyright Ⓒ 2024
Mirametrics, Inc. All Rights Reserved.