{"id":22505099,"url":"https://github.com/guilleatm/tilemap","last_synced_at":"2025-03-27T23:22:18.972Z","repository":{"id":156098917,"uuid":"307685790","full_name":"guilleatm/tilemap","owner":"guilleatm","description":"Small library for creating (visually), editing and using tilemaps with Löve2D. No warranties.","archived":false,"fork":false,"pushed_at":"2020-11-01T23:08:40.000Z","size":166,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-02-02T01:27:49.518Z","etag":null,"topics":["game-development","gamedev","love2d","lua","tilemap","tilemap-editor"],"latest_commit_sha":null,"homepage":"","language":"Lua","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/guilleatm.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-10-27T12:02:17.000Z","updated_at":"2024-01-12T17:32:39.000Z","dependencies_parsed_at":null,"dependency_job_id":"ae7b0a47-50a3-4175-a90a-dc92328f61f8","html_url":"https://github.com/guilleatm/tilemap","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/guilleatm%2Ftilemap","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/guilleatm%2Ftilemap/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/guilleatm%2Ftilemap/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/guilleatm%2Ftilemap/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/guilleatm","download_url":"https://codeload.github.com/guilleatm/tilemap/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245938878,"owners_count":20697106,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["game-development","gamedev","love2d","lua","tilemap","tilemap-editor"],"created_at":"2024-12-07T00:14:19.269Z","updated_at":"2025-03-27T23:22:18.955Z","avatar_url":"https://github.com/guilleatm.png","language":"Lua","readme":"# Tilemap\n\n## Description\n\nThree classes to create and use tilemaps.  \nIt is possible to animate the tiles (thanks to the animation class)  \nMIT License.  \nGive a star to the repo if you use the library :) and report any bug, thanks. I will fix the bugs and appreciate the stars.\nThe code were not be tested so it can have bugs :o  \n\n\u003e Classes:  \n\u003e TilemapEditor --\u003e Tilemap --\u003e Tile  \n\u003e TilemapEditorControls (not a class)\n\n\u003e For using the complete library you have to have the files: Tile.lua, Tilemap.lua, TilemapEditor.lua, TilemapEditorControls.lua and camera.lua.  \nIf you want to animate the tiles, you will need Animation.lua too.  \n\nThat is all what you have to include in the code:  \n\n```lua\n\trequire 'TilemapEditor'\n\trequire 'Animation'\n```\n\n\u003e Probably, you don't want let players edit the tilemap, then, you don't want to include the tilemapEditor in the code of the game, you can simply include what you use:\n\n```lua\n\trequire 'Tilemap'\n\trequire 'Animation'\n```\n\n---\n\n## Creating a tilemap with tilemapEditor\n\n```TilemapEditor:new(tileSize, pathToTiles)``` Creates a tilemap editor **indispensable for using the tilemapEditor**\n\nAll parameters:  \n```TilemapEditor:new(tileSize, pathToTiles, relativeWidth, relativeHeight, offsetX, offsetY, tilemap, tileSet)``` Creates a tilemap editor\n\n* **tileSize**: The size of the tiles in the game (it is not the size of the image of the tile)\n* **pathToTiles**: A string with the path to the folder that contains **all** the tile images.\n\n* Test yourself with the other arguments\n\n* **tilemap**: A tilemap object for edit.\n\u003e It is better to use the TilemapEditor:load() (changing to unammedTilemap.lua)\n\n* **tileSet**: Probably this don't work, sorry.\n\n---\n\n## Editing the tilemap\n\nLeft click in the tileSet for selecting a tile.  \n\nLeft click in the tilemap zone for adding the last tile selected in the tileset.\nRight click for deleting the last tile in the space.\n\n\u003e You can have more tnah one tile in the same gap. This is perfect for backgrounds and transparencies but be careful with clicking a lot of times, a lot of tiles will be stored in the same gap!! (Not good for perfomance)  \n\nUse the arrow keys for moving around the tilemap.\n\n\u003e The tilemap have NO LIMITS ;)  \n\u003e It can have any shape (haven't to be rectangular)  \n\u003e The cost of looking for a tile is log(n) (Good performance)\n\n---\n\u003e **Remember to change the name of the tilemapEditor object in TilemapEditorControls. Default is myTilemapEditor**.\n\n\u003e You can change the controls too.\n\n## Saving the tilemap\n\nIf you do not change the default controls, only by pressing ***s***, the tilemap will be stored in the default path (the tilemap folder) under the name unammedTilemap.lua. **Remember to rename the file if you don't want to overrite it**\n\nCheck the code if you need to save the tilemaps in a specifid folder. (You will need to do it trought coding)\n\n## Loading a tilemap\n\nPress ***l*** for loading the unammedTilemap.lua tilemap.\n\nCheck the code for more. (You will need to do it trought coding)\n\n## Clear tilemap\n\nPress ***c***.\n\n---\n\n## Animate tiles.\nUse Tile:animate() for animating the tiles.  \n\u003e See animation documentation\n\n---\n\n# Example\n\n```lua\nrequire('TilemapEditor')\nrequire('Animation')\n\nfunction love.load()\n\tlocal pathToTiles = \"media/img/tiles/\"\n\tmyTilemapEditor = TilemapEditor:new(64, pathToTiles, 0.5, 0.5)\nend\n\n\nfunction love.update(dt)\n\nend\n\n\nfunction love.draw()\n\tmyTilemapEditor:draw()\nend\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fguilleatm%2Ftilemap","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fguilleatm%2Ftilemap","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fguilleatm%2Ftilemap/lists"}