justgook/elm-tiled/3.0.1

NOTE: the latest version is 3.0.2

Tiled.Layer

type Layer
= Image ImageData
| Object ObjectData
| Tile TileData
| InfiniteTile TileChunkedData
decode : Bool -> Decoder Layer
encode : Layer -> Value
type alias TileData =
{ id : Int
, data : List Int
, name : String
, opacity : Float
, visible : Bool
, width : Int
, height : Int
, x : Float
, y : Float
, properties : Properties
}
  • data List of GIDs from Tileset.
  • name Name assigned to this layer
  • x Horizontal layer offset in tiles. Always 0.
  • y Vertical layer offset in tiles. Always 0.
  • width Column count. Same as map width for fixed-size maps.
  • height Row count. Same as map height for fixed-size maps.
  • opacity Value between 0 and 1
  • properties A list of properties (name, value, type).
  • visible Whether layer is shown or hidden in editor
type alias ImageData =
{ id : Int
, image : String
, name : String
, opacity : Float
, visible : Bool
, x : Float
, y : Float
, transparentcolor : String
, properties : Properties
}
  • image - Image used as background
  • name Name assigned to this layer
  • x Horizontal layer offset in tiles. Always 0.
  • y Vertical layer offset in tiles. Always 0.
  • opacity Value between 0 and 1
  • properties A list of properties (name, value, type).
  • visible Whether layer is shown or hidden in editor
type alias ObjectData =
{ id : Int
, draworder : DrawOrder
, name : String
, objects : List Object
, opacity : Float
, visible : Bool
, x : Float
, y : Float
, color : String
, properties : Properties
}
  • name Name assigned to this layer
  • x Horizontal layer offset in tiles. Always 0.
  • y Vertical layer offset in tiles. Always 0.
  • draworder TopDown (default)
  • objects List of objects. objectgroup only.
  • opacity Value between 0 and 1
  • properties A list of properties (name, value, type).
  • visible Whether layer is shown or hidden in editor
= TopDown
| Index
type alias Chunk =
{ data : List Int
, height : Int
, width : Int
, x : Int
, y : Int
}
  • data array or string Array of unsigned int (GIDs) or base64-encoded data
  • height int Height in tiles
  • width int Width in tiles
  • x int X coordinate in tiles
  • y int Y coordinate in tiles
type alias TileChunkedData =
{ id : Int
, chunks : List Chunk
, name : String
, opacity : Float
, visible : Bool
, width : Int
, height : Int
, startx : Int
, starty : Int
, x : Float
, y : Float
, properties : Properties
}

Internal