nodesnim/core/anchor

Types

AnchorObj = object
  x1*, y1*, x2*, y2*: float

Lets

START_ANCHOR = AnchorObj(x1: 0, y1: 0, x2: 0, y2: 0)
CENTER_ANCHOR = AnchorObj(x1: 0.5, y1: 0.5, x2: 0.5, y2: 0.5)
END_ANCHOR = AnchorObj(x1: 1, y1: 1, x2: 1, y2: 1)
START_END_ANCHOR = AnchorObj(x1: 0, y1: 1, x2: 0, y2: 1)
END_START_ANCHOR = AnchorObj(x1: 1, y1: 0, x2: 1, y2: 0)

Procs

proc Anchor(x1, y1, x2, y2: float): AnchorObj {...}{.inline, raises: [], tags: [].}

Creates a new anchor object.

Arguments:

  • x1, y1 -- usually anchor to the parent node.
  • x2, y2 -- usually anchor to the current node.

See also:

proc Anchor(vec1, vec2: Vector2Obj): AnchorObj {...}{.inline, raises: [], tags: [].}

Creates a new anchor object.

Arguments:

  • vec1 -- usually anchor to the parent node.
  • vec2 -- usually anchor to the current node.

See also:

proc Anchor(): AnchorObj {...}{.inline, raises: [], tags: [].}
Creates empty Anchor object.
proc clear(a: var AnchorObj) {...}{.raises: [], tags: [].}
Cleares current anchor object.
proc isEmpty(a: AnchorObj): bool {...}{.inline, raises: [], tags: [].}
Returns true, if a is Anchor(0, 0, 0, 0)
proc `$`(x: AnchorObj): string {...}{.inline, raises: [], tags: [].}
proc `==`(x, y: AnchorObj): bool {...}{.inline, raises: [], tags: [].}