Skip to content

Commit 82cde9e

Browse files
committed
Add grid.md, update related files
1 parent 0ced577 commit 82cde9e

File tree

3 files changed

+57
-1
lines changed

3 files changed

+57
-1
lines changed

api/grid.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
## Grid
2+
3+
This is an object that defines the grid for a [tileset](tileset.md#tileset).
4+
5+
## Grid()
6+
7+
```lua
8+
Grid()
9+
Grid(otherGrid)
10+
```
11+
12+
## Grid.tileSize
13+
14+
```lua
15+
local tileSize = grid.tileSize
16+
```
17+
18+
Returns the [tile](tile.md#tile) width and height of a [tileset](tileset.md#tileset), as a [size](size.md#size).
19+
20+
## Grid.origin
21+
22+
```lua
23+
local point = grid.origin
24+
```
25+
26+
Returns the origin of the grid as a [point](point.md#point).

api/tileset.md

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,49 @@
11
# Tileset
22

3+
A set of [tiles](tile.md#tile).
4+
35
## Tileset.name
46

5-
## Tileset.grid
7+
```lua
8+
local name = tileset.name
9+
tileset.name = name
10+
```
11+
12+
Gets or sets the name of this tileset.
613

714
## Tileset.baseIndex
815

16+
```lua
17+
local baseindex = tileset.baseIndex
18+
tileset.baseIndex = baseindex
19+
```
20+
21+
Gets or sets the base index of this tileset.
22+
923
## Tileset.color
1024

1125
## Tileset.data
1226

27+
```lua
28+
local data = tileset.data
29+
tileset.data = data
30+
```
31+
32+
Gets or sets the user-defined data related to this tileset (a text string).
33+
1334
## Tileset.properties
1435

1536
Access user-defined and extension-defined
1637
[properties](properties.md#properties) of this tileset.
1738

39+
## Tileset.grid
40+
41+
```lua
42+
local grid = tileset.grid
43+
```
44+
45+
Returns the [grid](grid.md#grid) of this tileset.
46+
1847
## Tileset:tile()
1948

2049
```lua

sidebar.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ Classes/objects
3939
* [Events](api/events.md#events)
4040
* [Frame](api/frame.md#frame)
4141
* [GraphicsContext](api/graphicscontext.md#graphicscontext)
42+
* [Grid](api/grid.md#grid)
4243
* [Image](api/image.md#image)
4344
* [ImageSpec](api/imagespec.md#imagespec)
4445
* [KeyEvent](api/keyevent.md#keyevent)

0 commit comments

Comments
 (0)