Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
Kyrremann committed Jan 12, 2015
1 parent c001e73 commit 543f27c
Showing 1 changed file with 50 additions and 3 deletions.
53 changes: 50 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# LuaPill
Practical Isometric Layering Library
LuaPill (short for "Practical Isometric Layering Library for Lua") is an engine for generating isometric maps for Löve2D and Lua. See [Example](README.md#example) for usage, or try the soon-coming [demo]().

## Example
```lua
Expand Down Expand Up @@ -44,8 +44,56 @@ config = {
```

## API
```lua
function luapill:saveMap()
```
Called to save the current map and tiles. Output in JSON-format.
```lua
function luapill:loadMap(path)
```
Load a map from a given path.
```lua
function luapill:getTile(index)
```
Get the tile based on the index it has in the image folder.
```lua
function luapill:getTileCount()
```
Number of tiles in the image folder.
```lua
function luapill:getScale()
```
Current scale or zoom-level.
```lua
function luapill:mousepressed(x, y, button)
```
Sends mouse pressed to the library.
```lua
function luapill:keyreleased(key)
```
Sends key realeasing to the library.
```lua
function luapill:keypressed(key)
```
Sends key pressing to the library.
```lua
function luapill:getMouseAsMap()
```
Get mouse coordinates as a map, call goes through <code>screenToMap()</code>.
```lua
function luapill:screenToMap(screen)
```
Converts screen coordinates (pixels) to map coordinates (double array).
```lua
function luapill:mapToScreen(map)
```
Converts map coordinates (double array) to screen coordinates (pixels).
```lua
function luapill:draw()
```
Draws the map to the screen, usually called in love.draw()

## Input
## Input/controls
* Move tile with mouse
* Left click to place tile
* Right click to rotate (only works if the tiles are sorted)
Expand All @@ -58,7 +106,6 @@ config = {
* Use WASD to move around the map

## TODO
* Add sidebar that show the current tile and what is before and after
* Load map frome file
* Save map to file
* Different elevation
Expand Down

0 comments on commit 543f27c

Please sign in to comment.