1.122 class point

A point describes a discrete position in an infinite two-dimensional plain. Points are used to describe positions when communicating with graphical objects.

Note that the coordinate system used by PCE deals both with negative and positive coordinates.

See also
- class size
- class area

1.122.1 Instance variables

point <-> x: int
Coordinate of the point object. Most graphical objects interpret the value in pixel units.
point <-> y: int
Inherits description from: point-x

1.122.2 Send methods

point ->copy: from=point
Copy x- and y values from the argument. See also point<-copy, object<-clone and point->set.
point ->equal: to=point
Succeeds if point<-x and point<-y of both points are equal. See also object->equal and object->same_reference.
point ->initialise: x=[int], y=[int]
Create a point object from its point<-x and point<-y value. When a value is omitted, 0 is used.
point ->offset: dx=int, dy=int
Add dx to point<-x and dy to point<-y. See also point->plus.

1.122.3 Get methods

point <-convert: event|char_array -> point
Convert event to its position relative to its receiver using event<-position or a text of the form _<number>, <number>_. The latter is discouraged (backward compatibility).
See also
event<-position
point <-copy: -> point
New point with same point<-x and point<-y. The copy is created using the equivalent of the expression below.
?(P?class, instance, ?(P, slot, x), ?(P, slot, y))

See also point->copy.

point <-difference: to=point -> point
New point with point<-x and point<-y obtained by subtracting the receiver's coordinates from the argument (vector subtraction). See also point<-distance and point->minus.
point <-distance: to=point -> int
Rounded integer reflecting the (pixel) distance between both points.
point <-print_name: -> string
Printed representation as <x>,<y>