new_point

CPoint Class Description


The CPoint class holds a pair of numbers teated as a single object, much like a point on the (x,y) plane. This class is useful for simplifying scripts that work with pairs of numbers. In addition to several class methods, many operations between CPoint objects and other objects use math operators that work outside of class methods.

Class Properties

This class has 2 properties that describe the point and may be directly used. For example, if the class object is P, then the x value is accessed by P.x. You can access this and other properties directly or use the accessor methods like Set. Remember that properties use the dot operator and methods use the colon operator.

x

The x coordinate of the point.

y

The y coordinate of the point.

Usage

Construction

Object = new_point()

Object = CPoint:new()

Destruction

Object:delete()

Operatorions between CPoint Objects

Math Operators

This class provides simple arithmetic and comparision operations between objects.

Creation - Non-class Functions

This function is normally used to create a new CPoint object as an alternative to the class-based new method.

new_point

Global function that creates a new CPoint object.

Construction and Destruction - Class Methods

new

Creates a new instance of the CPoint class.

delete

Deletes the instance of the CPoint object.

Operations

Ceil

Elevates the x and y properties to the next higher integer value.

Floor

Truncates the x and y properties to the next lower integer value.

Offset

Offsets both class members x and y by adding values to them.

Round

Rounds the x and y properties to the closest integer value.

Set

Sets the values of class members x and y.

Related Topics

Script Classes

CRect class

 


Mira Pro x64 Script User's Guide, v.8.73 Copyright Ⓒ 2024 Mirametrics, Inc. All Rights Reserved.