RegionAddRect

Parameters
whichRegion region

The region to be modified.

r rect

The rect whose cells to add.

comment

Adds the cells of a rect to a region.

note

Cells are 32x32 world units and aligned with multiples of 32 in each direction (smallest grid in World Editor).

note

The current cells of the rect are transferred. Changing the rect afterwards has no effect on the region.

note

Even if the rect is moved out of map bounds, only cells within the map bounds will be added to the region.

bug

An extra row and column of cells in positive x and y direction is added. E.g., if the rect is [minX=0, minY=0, maxX=96, maxY=96], the region will gain cells spanning the area [minX=0, minY=0, maxX=128, maxY=128]. This is reflected in IsPointInRegion, IsUnitInRegion, TriggerRegisterEnterRegion and TriggerRegisterLeaveRegion. It still respects the map bounds.

patch

1.00

Source
common.j
return type
nothing
Source code
native RegionAddRect            takes region whichRegion, rect r returns nothing