Repository navigation
Expand file tree
/
Copy pathIgeTileMapStack2d.html
More file actions
169 lines (155 loc) · 12.2 KB
/
Copy pathIgeTileMapStack2d.html
File metadata and controls
169 lines (155 loc) · 12.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
<html>
<head>
<link type="text/css" rel="stylesheet" href="../css/default.css" />
<link type="text/css" rel="stylesheet" href="../js/rainbow/themes/sunburst.css">
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>
</head>
<body>
<div class="page">
<h2>IgeTileMapStack2d <span>CLASS</span></h2>
<p>Declared in <a href="../../engine/core/IgeTileMapStack2d.js">IgeTileMapStack2d.js</a></p>
<div class="itemBox">
<div class="header">Description</div>
<div class="content">Tile maps provide a way to align mounted child objects to a tile-based grid. NOTE: These are not to be confused with IgeTextureMap's which allow you to paint a bunch of tiles to a grid.</div>
</div>
<!--=if{extends}[-->
<div class="itemBox">
<div class="header">Extends</div>
<div class="content"><a href="IgeEntity.html">IgeEntity</a></div>
</div>
<!--=if{extends}]-->
<h2>Methods</h2><a name="drawGrid"></a>
<h3 class="methodTitle">drawGrid</h3>
<div class="methodSection">
<!--=if{desc}[-->
<div class="methodDesc">Gets / sets the number of grid cells that the tile map should paint to the context during the tick method.</div>
<!--=if{desc}]-->
<div class="methodDefinition"><span class="methodName">drawGrid</span>({<span class="argType"></span>} <span class="argName">val</span>)</div>
<div class="methodArgs"><ul class="argList"><li>{<span class="argType"></span>}<span class="argName">val</span> </li></ul></div>
<div class="methodReturnDesc">Returns {<span class="argType">*</span>} </div>
</div><a name="highlightOccupied"></a>
<h3 class="methodTitle">highlightOccupied</h3>
<div class="methodSection">
<!--=if{desc}[-->
<div class="methodDesc">Gets / sets the flag that determines if the tile map will paint the occupied tiles with an overlay colour so that it is easy to spot them.</div>
<!--=if{desc}]-->
<div class="methodDefinition"><span class="methodName">highlightOccupied</span>({<span class="argType"></span>} <span class="argName">val</span>)</div>
<div class="methodArgs"><ul class="argList"><li>{<span class="argType"></span>}<span class="argName">val</span> </li></ul></div>
<div class="methodReturnDesc">Returns {<span class="argType">*</span>} </div>
</div><a name="tileWidth"></a>
<h3 class="methodTitle">tileWidth</h3>
<div class="methodSection">
<!--=if{desc}[-->
<div class="methodDesc">Gets / sets the map's tile width.</div>
<!--=if{desc}]-->
<div class="methodDefinition"><span class="methodName">tileWidth</span>({<span class="argType">Number</span>} <span class="argName">val</span>)</div>
<div class="methodArgs"><ul class="argList"><li>{<span class="argType">Number</span>}<span class="argName">val</span> Tile width.</li></ul></div>
<div class="methodReturnDesc">Returns {<span class="argType">*</span>} </div>
</div><a name="tileHeight"></a>
<h3 class="methodTitle">tileHeight</h3>
<div class="methodSection">
<!--=if{desc}[-->
<div class="methodDesc">Gets / sets the map's tile height.</div>
<!--=if{desc}]-->
<div class="methodDefinition"><span class="methodName">tileHeight</span>({<span class="argType">Number</span>} <span class="argName">val</span>)</div>
<div class="methodArgs"><ul class="argList"><li>{<span class="argType">Number</span>}<span class="argName">val</span> Tile height.</li></ul></div>
<div class="methodReturnDesc">Returns {<span class="argType">*</span>} </div>
</div><a name="_objectOccupyTile"></a>
<h3 class="methodTitle">_objectOccupyTile</h3>
<div class="methodSection">
<!--=if{desc}[-->
<div class="methodDesc">Attached to objects that are mounted to the tile sheet. Adds the object to the tile map at the passed tile co-ordinates. If no tile co-ordinates are passed, will use the array returned from calling overTiles() and will add the object to each tile the object is "over".</div>
<!--=if{desc}]-->
<div class="methodDefinition"><span class="methodName">_objectOccupyTile</span>({<span class="argType">Number</span>} <span class="argName">x</span>, {<span class="argType">Number</span>} <span class="argName">y</span>, {<span class="argType">Number</span>} <span class="argName">width</span>, {<span class="argType">Number</span>} <span class="argName">height</span>)</div>
<div class="methodArgs"><ul class="argList"><li>{<span class="argType">Number</span>}<span class="argName">x</span> </li><li>{<span class="argType">Number</span>}<span class="argName">y</span> </li><li>{<span class="argType">Number</span>}<span class="argName">width</span> </li><li>{<span class="argType">Number</span>}<span class="argName">height</span> </li></ul></div>
<div class="methodReturnDesc"></div>
</div><a name="_objectUnOccupyTile"></a>
<h3 class="methodTitle">_objectUnOccupyTile</h3>
<div class="methodSection">
<!--=if{desc}[-->
<div class="methodDesc">Attached to objects that are mounted to the tile sheet. Removes the object from the tile map at the passed tile co-ordinates. If no tile co-ordinates are passed, will use the array returned from calling overTiles() and will remove the object from each tile the object is "over".</div>
<!--=if{desc}]-->
<div class="methodDefinition"><span class="methodName">_objectUnOccupyTile</span>({<span class="argType">Number</span>} <span class="argName">x</span>, {<span class="argType">Number</span>} <span class="argName">y</span>, {<span class="argType">Number</span>} <span class="argName">width</span>, {<span class="argType">Number</span>} <span class="argName">height</span>)</div>
<div class="methodArgs"><ul class="argList"><li>{<span class="argType">Number</span>}<span class="argName">x</span> </li><li>{<span class="argType">Number</span>}<span class="argName">y</span> </li><li>{<span class="argType">Number</span>}<span class="argName">width</span> </li><li>{<span class="argType">Number</span>}<span class="argName">height</span> </li></ul></div>
<div class="methodReturnDesc"></div>
</div><a name="_objectOverTiles"></a>
<h3 class="methodTitle">_objectOverTiles</h3>
<div class="methodSection">
<!--=if{desc}[-->
<div class="methodDesc">Attached to objects that are mounted to the tile sheet. This method returns an array of tile co-ordinates that the object is currently over, calculated using the current world co-ordinates of the object as well as it's 3d geometry.</div>
<!--=if{desc}]-->
<div class="methodDefinition"><span class="methodName">_objectOverTiles</span>()</div>
<div class="methodArgs"></div>
<div class="methodReturnDesc">Returns {<span class="argType">Array</span>} The array of tile co-ordinates as IgePoint instances.</div>
</div><a name="occupyTile"></a>
<h3 class="methodTitle">occupyTile</h3>
<div class="methodSection">
<!--=if{desc}[-->
<div class="methodDesc">Sets a tile or area as occupied by the passed obj parameter. Any previous data on the specified tile or area will be removed.</div>
<!--=if{desc}]-->
<div class="methodDefinition"><span class="methodName">occupyTile</span>({<span class="argType">Number</span>} <span class="argName">x</span>, {<span class="argType">Number</span>} <span class="argName">y</span>, {<span class="argType">Number</span>} <span class="argName">width</span>, {<span class="argType">Number</span>} <span class="argName">height</span>, {<span class="argType">*</span>} <span class="argName">obj</span>)</div>
<div class="methodArgs"><ul class="argList"><li>{<span class="argType">Number</span>}<span class="argName">x</span> </li><li>{<span class="argType">Number</span>}<span class="argName">y</span> </li><li>{<span class="argType">Number</span>}<span class="argName">width</span> </li><li>{<span class="argType">Number</span>}<span class="argName">height</span> </li><li>{<span class="argType">*</span>}<span class="argName">obj</span> </li></ul></div>
<div class="methodReturnDesc">Returns {<span class="argType">*</span>} </div>
</div><a name="unOccupyTile"></a>
<h3 class="methodTitle">unOccupyTile</h3>
<div class="methodSection">
<!--=if{desc}[-->
<div class="methodDesc">Removes all data from the specified tile or area.</div>
<!--=if{desc}]-->
<div class="methodDefinition"><span class="methodName">unOccupyTile</span>({<span class="argType">Number</span>} <span class="argName">x</span>, {<span class="argType">Number</span>} <span class="argName">y</span>, {<span class="argType">Number</span>} <span class="argName">width</span>, {<span class="argType">Number</span>} <span class="argName">height</span>)</div>
<div class="methodArgs"><ul class="argList"><li>{<span class="argType">Number</span>}<span class="argName">x</span> </li><li>{<span class="argType">Number</span>}<span class="argName">y</span> </li><li>{<span class="argType">Number</span>}<span class="argName">width</span> </li><li>{<span class="argType">Number</span>}<span class="argName">height</span> </li></ul></div>
<div class="methodReturnDesc">Returns {<span class="argType">*</span>} </div>
</div><a name="isTileOccupied"></a>
<h3 class="methodTitle">isTileOccupied</h3>
<div class="methodSection">
<!--=if{desc}[-->
<div class="methodDesc">Returns true if the specified tile or tile area has an occupied status.</div>
<!--=if{desc}]-->
<div class="methodDefinition"><span class="methodName">isTileOccupied</span>({<span class="argType">Number</span>} <span class="argName">x</span>, {<span class="argType">Number</span>} <span class="argName">y</span>, {<span class="argType">Number</span>} <span class="argName">width</span>, {<span class="argType">Number</span>} <span class="argName">height</span>)</div>
<div class="methodArgs"><ul class="argList"><li>{<span class="argType">Number</span>}<span class="argName">x</span> </li><li>{<span class="argType">Number</span>}<span class="argName">y</span> </li><li>{<span class="argType">Number</span>}<span class="argName">width</span> </li><li>{<span class="argType">Number</span>}<span class="argName">height</span> </li></ul></div>
<div class="methodReturnDesc">Returns {<span class="argType">*</span>} </div>
</div><a name="pointToTile"></a>
<h3 class="methodTitle">pointToTile</h3>
<div class="methodSection">
<!--=if{desc}[-->
<div class="methodDesc">Returns the tile co-ordinates of the tile that the point's world co-ordinates reside inside.</div>
<!--=if{desc}]-->
<div class="methodDefinition"><span class="methodName">pointToTile</span>({<span class="argType"></span>} <span class="argName">point</span>)</div>
<div class="methodArgs"><ul class="argList"><li>{<span class="argType"></span>}<span class="argName">point</span> </li></ul></div>
<div class="methodReturnDesc">Returns {<span class="argType">*</span>} </div>
</div><a name="mouseTileWorldXY"></a>
<h3 class="methodTitle">mouseTileWorldXY</h3>
<div class="methodSection">
<!--=if{desc}[-->
<div class="methodDesc">Returns the world co-ordinates of the tile the mouse is currently over.</div>
<!--=if{desc}]-->
<div class="methodDefinition"><span class="methodName">mouseTileWorldXY</span>()</div>
<div class="methodArgs"></div>
<div class="methodReturnDesc">Returns {<span class="argType">IgePoint</span>} </div>
</div><a name="mouseToTile"></a>
<h3 class="methodTitle">mouseToTile</h3>
<div class="methodSection">
<!--=if{desc}[-->
<div class="methodDesc">Returns the tile co-ordinates of the tile the mouse is currently over.</div>
<!--=if{desc}]-->
<div class="methodDefinition"><span class="methodName">mouseToTile</span>()</div>
<div class="methodArgs"></div>
<div class="methodReturnDesc">Returns {<span class="argType">IgePoint</span>} </div>
</div><a name="_calculateMousePosition"></a>
<h3 class="methodTitle">_calculateMousePosition</h3>
<div class="methodSection">
<!--=if{desc}[-->
<div class="methodDesc">Sets the internal mouse position data based on the current mouse position relative to the tile map.</div>
<!--=if{desc}]-->
<div class="methodDefinition"><span class="methodName">_calculateMousePosition</span>()</div>
<div class="methodArgs"></div>
<div class="methodReturnDesc"></div>
</div> </div>
<script type="text/javascript">
$(function () {
$('code').attr('data-language', 'javascript');
});
</script>
<script type="text/javascript" src="../js/rainbow/rainbow-custom.min.js"></script>
</body>
</html>