Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface region

Holds a discrete region, usually of a TileLayer.

note

When iterating all the locations within a region, don't use boundingRect in combination with contains! It is much faster to iterate over rects instead.

Hierarchy

  • region

Index

Properties

Readonly boundingRect

boundingRect: rect

Bounding rectangle of this region.

Readonly rects

rects: rect[]

Array of rectangles making up this region.

since

1.8

Methods

add

  • Adds the given rectangle to this region.

    since

    1.8

  • Adds the given region to this region.

    since

    1.8

contains

  • contains(x: number, y: number): boolean
  • contains(point: point): boolean
  • Returns whether this region contains the given point.

    since

    1.8

  • Returns whether this region contains the given point.

    since

    1.8

contiguousRegions

  • contiguousRegions(): region[]
  • Returns this region as an array of contiguous regions, based on 8-way connectivity (regions touching each other diagonally are considered one contiguous region).

    The returned regions are guaranteed not to touch each other.

    since

    1.10

intersect

  • intersect(rect: rect): void
  • intersect(region: region): void
  • Sets the selected area to the intersection of the current selected area and the given rectangle.

    since

    1.8

  • Sets the selected area to the intersection of the current selected area and the given region.

    since

    1.8

subtract

  • subtract(rect: rect): void
  • subtract(region: region): void
  • Subtracts the given rectangle from this region.

    since

    1.8

  • Subtracts the given region from this region.

    since

    1.8

Generated using TypeDoc