comet.rect

The comet.rect module is the factory for comet.CRect objects.

Methods

comet.rect.create(left, top, right, bottom)

Create a rectangle with the given side coordinates.

Parameters
  • left (float) – Left side

  • top (float) – Top side

  • right (float) – Right side

  • bottom (float) – Bottom side

Returns

The new rectangle

Return type

CRect

Raises

TypeError – When parameter types are invalid

Available

CScript

rect::alloc

comet.rect.createSquare(edgeLength, x=0.0, y=0.0)

Create a square rectangle with the given edge length at the given coordinates

Parameters
  • edgeLength (float) – The edge length of all edges

  • x (float) – Horizontal center of the rectangle

  • y (float) – Vertical center of the rectangle

Returns

The new rectangle

Return type

CRect

Raises
  • TypeError – When parameter types are invalid

  • ValueError – When parameter edgeLength has invalid value

Available

CScript

rect::alloc