Module common

Types

TCallback = proc (obj: PObject; sender: PObject) {.closure.}
TPoint = tuple[x: int, y: int]
TCircle = tuple[x: int, y: int, r: uint]
TVector = tuple[x: float, y: float]

Consts

UE_UPDATE_TIMER = 1
UE_UPDATE_INFO = 2

Procs

proc distance(a: TPoint; b: TPoint): float
Return distance between two points.
proc direction(a: TPoint; b: TPoint): float
Return angle direction from one to other point.
proc vector(angle: float; size: float = 1.0000000000000000e+00): TVector {.
    inline.}
proc vectorX(angle: float; size: float = 1.0000000000000000e+00): float {.inline.}
proc vectorY(angle: float; size: float = 1.0000000000000000e+00): float {.inline.}
proc absVector(vector: TVector): float {.inline.}
Get absolute size of vector.
proc absVector(x, y: float): float {.inline.}
proc color(r: int; g: int; b: int): TColor {.inline.}
Return TColor created from given r, g, b components.
proc check(ret: int): void
SDL errors handling wrapper.
proc check(ret: TBool): void
SDL errors handling wrapper.
proc check(ret: PSurface): PSurface
SDL errors handling wrapper.
proc check(ret: PFont): PFont
SDL TTF errors handling wrapper.

Templates

template distance(ax, ay: int; b: TPoint): float
template distance(a: TPoint; bx, by: int): float
template distance(ax, ay: int; b: TPoint): float
template distance(a: TPoint; bx, by: int): float
template direction(ax, ay: int; b: TPoint): float
template direction(a: TPoint; bx, by: int): float
template direction(ax, ay: int; b: TPoint): float
template direction(a: TPoint; bx, by: int): float
template toRad(a: float): expr
template toDeg(a: float): expr
Generated: 2012-11-11 20:09:27 UTC