This is an alternative site for discovering Elm packages. You may be looking for the official Elm package site instead.
Decoder for Tiled maps (http://www.mapeditor.org/)
version 2.1.1
license BSD3
native-modules False
elm-version 0.18.0 <= v < 0.19.0
Tag 2.1.1
Committed At 2018-06-08 10:36:14 UTC
newlandsvalley/elm-binary-base64 1.0.1 <= v < 2.0.0 1.0.3
elm-lang/core 5.1.1 <= v < 6.0.0 5.1.1
NoRedInk/elm-decode-pipeline 3.0.0 <= v < 4.0.0 3.0.1

Modules

README

A library for building decoders for Tiled levels.

Motivation

I can not find good library that decodes Tiled data and is up to date, and use JavaScript ports was not an option.

Examples


import Html
import Http
import Tiled.Decode as Tiled


type Message
    = LevelLoaded (Result Http.Error Tiled.Level)


load : String -> Cmd Message
load url =
    Http.send LevelLoaded <| Http.get url Tiled.decode


main : Program Never Tiled.Level Message
main =
    Html.program
        { init = ( Tiled.empty, load "./some_tiled_level.json" )
        , update = update
        , subscriptions = \_ -> Sub.none
        , view = view
        }


view : Tiled.Level -> Html.Html Message
view model =
    Html.text (toString model)


update : Message -> Tiled.Level -> ( Tiled.Level, Cmd msg )
update msg model =
    case msg of
        LevelLoaded (Ok level) ->
            ( level, Cmd.none )

        LevelLoaded (Err _) ->
            ( model, Cmd.none )