class org.aswing.geom.IntPoint

A point with x and y coordinates in int. @author paling

Class Fields

static function creatWithPoint(p:Point): IntPoint

Create a int point with point.

Instance Fields

var x:Int

var y:Int

function new(?x:Int = 0, ?y:Int = 0): Void

Constructor

function clone(): IntPoint

Duplicates current instance.

returns

copy of the current instance.

function distance(p:IntPoint): Int

Returns the distance between this point and passing point.

p

the another point.

returns

the distance from this to p.

function distanceSq(p:IntPoint): Int

Returns the distance square between this point and passing point.

p

the another point.

returns

the distance square from this to p.

function equals(o:Dynamic): Bool

Returns whether or not this passing object is a same value point.

toCompare

the object to be compared.

returns

equals or not.

function move(dx:Int, dy:Int): IntPoint

Moves this point and return itself.

dx

delta of x.

dy

delta of y.

returns

the point itself.

function moveRadians(direction:Int, distance:Int): IntPoint

Moves this point with an direction in radians and distance, then return itself.

angle

the angle in radians.

distance

the distance in pixels.

returns

the point itself.

function nextPoint(direction:Float, distance:Float): IntPoint

Returns the point beside this point with direction and distance.

returns

the point beside.

function setLocation(p:IntPoint): Void

Sets the location of this point as same as point p.

p

the location to be set.

function setLocationXY(?x:Int = 0, ?y:Int = 0): Void

Sets the location of this point with x and y.

x

the x coordinates.

y

the y coordinates.

function setWithPoint(p:Point): Void

Sets the location with a Point, the value will be transfer to int.

p

the location to be set.

function toPoint(): Point

Return a Point instance with same value.

function toString(): String