Git Product home page Git Product logo

tidal's Introduction

Tidal

Tidal loads and renders Tiled maps. Requires LÖVE

Currently compatible with Tiled 0.10.0

This was a fork of Kadoba's Advanced Tiled Loader. The majority of the code has been rewritten from the ground up. Latest update is found on the master branch.

Supports every known feature except for the following:

  • Specifying draw order

Stable release: v0.10.2

Please check out the wiki for help.

Alt text

Example:

tidal          = require 'src'
map            = tidal.load('map.tmx')
map.batch_draw = true -- Enable spritebatches (default)

layer = map.layerOrder[1]  -- Get lowest layer
layer.opacity      = 0.5   -- Set layer transparency
layer.ox, layer.oy = 5,5   -- Offset layer by these many pixels
layer.visible      = true  -- Set layer visibility
tile = layer:get(tx,ty)    -- Return tile at tx,ty

gid  = 1
tile = map.tiles[gid]             -- Get tile
print(tile.properties.myproperty) -- Get set property in Tiled

function love.update(dt)
	map:update(dt) -- For animating tiles
end

function love.draw()
	map:draw(x,y)
end

tidal's People

Contributors

floriancargoet avatar jamienicol avatar kadoba avatar kapec94 avatar kyleconroy avatar markandgo avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

tidal's Issues

Error when running example: attempt to call method 'bind' (a nil value)

I'm attempting to play with Tidal since it appears that the Advanced Tiled Loader was never updated for the current release of the LOVE framework.

However, when I run the example main.lua file in the master branch I get the following error:

src/TileLayer.lua:242: attempt to call method 'bind' (a nill value)

The specific line it's triggering on is in

main.lua: 120: in function 'draw'

Relevant code for a simplified example that triggers the same stack trace:

function love.load()
    tidal = require 'Tidal'

    map = tidal.load('maps/tilemap.tmx')

    x,y = 0,0
end

function love.update(dt)
    if map then
        map:update(dt)
    end
end

function love.draw()
    -- error occurs on the next line.
    map:draw(x,y)

end

Since this is also happening in the example I assume I'm not doing something wrong, but ...

Running the current version of LOVE on Windows.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.