Skip to content

Latest commit

 

History

History
57 lines (53 loc) · 1.69 KB

README.md

File metadata and controls

57 lines (53 loc) · 1.69 KB
┌─╖    ┌────╖ ┌───╖ ┌───╖
│ ║    └─┐╓─╜ │╓──╜ │┌──╜
│ ║      │║   │║    │└─╖ 
│ ║      │║   │║    │┌─╜ 
│ ╙──╖ ┌─┘╙─╖ │╙──╖ │└──╖
└────╜ └────╜ └───╜ └───╜

A löve library for drawing 3D isometric tile maps.


Basic usage:

  1. Require the file with local lice = require "folder.to.lice".
  2. Create an instance of a tilemap with local map = lice.new(sizeX, sizeY, sizeZ, atlas, tileWidth, tileHeight).
    • sizeX — Maximum size of the map.
    • sizeY — Maximum size of the map.
    • sizeZ — Maximum size of the map.
    • atlas — A texture atlas¹ for drawing the map.
    • tileWidth — Pixel width of a single tile in the atlas.
    • tileHeight — Pixel height of a single tile in the atlas.
  3. Set up the map data² like so: map:setLayerID(x, y, z, id, layer?).
  4. Draw the map in love.draw with map:draw(x, y, areaX?, areaY?, areaZ?, centerX?, centerY?, centerZ?).

Footnotes

¹ Texture atlases are expected to be a grid of tileWidth×tileHeight tiles. A 4×4 grid of textures would have IDs as follows:

1 2 3 4
5 6 7 8
9 10 11 12
13 14 15 16


² Map data is just an integer corresponding to an atlas ID (see footnote 1).