# WC3 JASS.com"The Jass Vault" plus vJASS and Zinc

 Warcraft III: Maps Models Skins Icons Spells / Systems Tools Tutorials vJASS & Zinc DocumentationFor the latest documentation about how it works vJASS and Zinc language layers for Warcraft III, please follow these links: Jasshelper documentation - Zinc documentation - WC3 Optimizer documentation

### WorldBounds Codes & Snippets

Started by
moyack

0 Members and 1 Guest are viewing this topic.

##### WorldBounds
on: February 21, 2012, 10:26:47 PM
Category: Geometry
Language: vJASS

Code: jass
1. library WorldBounds /* v2.0.0.0
2. ************************************************************************************
3. *
4. *       struct WorldBounds extends array
5. *
6. *               Fields
7. *               -------------------------
8. *
9. *                       readonly static integer maxX
10. *                       readonly static integer maxY
11. *                       readonly static integer minX
12. *                       readonly static integer minY
13. *
14. *                       readonly static integer centerX
15. *                       readonly static integer centerY
16. *
17. *                       readonly static rect world
18. *                       readonly static region worldRegion
19. *
20. ************************************************************************************/
21.         private module WorldBoundInit
22.                 private static method onInit takes nothing returns nothing
23.                         set world=GetWorldBounds()
24.
25.                         set maxX = R2I(GetRectMaxX(world))
26.                         set maxY = R2I(GetRectMaxY(world))
27.                         set minX = R2I(GetRectMinX(world))
28.                         set minY = R2I(GetRectMinY(world))
29.
30.                         set centerX = R2I((maxX + minX)/2)
31.                         set centerY = R2I((minY + maxY)/2)
32.
33.                         set worldRegion = CreateRegion()
34.
36.                 endmethod
37.         endmodule
38.
39.         struct WorldBounds extends array
44.
47.
49.