RegionAddRect
- Parameters
whichRegion regionThe region to be modified.
r rectThe 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,TriggerRegisterEnterRegionandTriggerRegisterLeaveRegion. It still respects the map bounds.- patch
1.00
- Source
- common.j (suggest an edit or discuss on Github)
- return type
nothing- Source code
native RegionAddRect takes region whichRegion, rect r returns nothing