Rect vs Region

jig7c

Stop reading me...-statement
Reaction score
123
What is a Rect, and how does it differ from a Region...

Unit Location is the point of that unit in the memory
X/Y is the location of that unit determined on an X/Y graph
Region is an area of the map, usually drawn with a blue square...

how do you use rects?

JASS:
local rect r
set r = //what goes here?//

//also is this possible//
local region r
set r = //what goes here, if anything?//
 

Komaqtion

You can change this now in User CP.
Reaction score
469
Well, rects are what you think regions are :p
When you e.g create a "region" in the Terrain Editor, you're actually creating a Rect ;)
That rect, let's name it "Region 1", will look like this in JASS:
[LJASS]gg_rct_Region_1[/LJASS]

And, if you want to create a rect in a trigger, you type [ljass]local rect r = Rect(minx, miny, maxx, maxy // I think these are the parameters, I'm at school now :p[/ljass]

I also believe that regions are a collection of rect, and you add rect to a region by using [ljass]RegionAddRect[/ljass] and you create a region by doing [ljass] local region r = CreateRegion()[/ljass]

Again, I don't have WE here, but something like that :D
 

jig7c

Stop reading me...-statement
Reaction score
123
thanks komaqtion for that..
but
can someone give me a more detail explanation?
 

PurgeandFire

zxcvmkgdfg
Reaction score
509
Regions allow you to add rects and cells. Regions can also allow for more dynamic shapes rather than just a rectangle. Regions are also used for events while rects aren't.

However, it really depends on what you're trying to do. Rects are probably used more as arguments and they are movable and what-not, while regions have a bit smaller of an API.
 

jig7c

Stop reading me...-statement
Reaction score
123
so when talking about size, its point < rect < cells < regions < entire map

how can a region be allowed "for more dynamic shapes" other than rectangles..
also... in the #1 post, the jass script, how do i go ahead setting a rect?
 

PurgeandFire

zxcvmkgdfg
Reaction score
509
JASS:
local real r = Rect(0,0,200,200)
native Rect                     takes real minx, real miny, real maxx, real maxy returns rect


Regions allow for more dynamic shapes because you can add cells, and because you can add rects. Say you have four rects, arrange them together and get a "+" symbol. You can add all those rects to the region and the region will thus have a "+" shape. By adding cells (32x32 I think) you can essentially get odd shapes, lines, curves, etc.

You can find some region funcs here:
http://wc3jass.com/viewforum.php?f=9&topicdays=0&start=50
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top