Safe Haskell | None |
---|---|
Language | Haskell2010 |
Data.Aeson.Tiled
Contents
Description
This module provides Haskell types for Tiled's JSON exports, which you can read about at http://doc.mapeditor.org/en/latest/reference/json-map-format/. That said - as of the writing of this module the JSON documentation does not cover some of the types and records that are available in the format. For those you should read the TMX documentation at http://doc.mapeditor.org/en/latest/reference/tmx-map-format/
- newtype GlobalId = GlobalId {
- unGlobalId :: Int
- newtype LocalId = LocalId {}
- data Object = Object {
- objectId :: Int
- objectWidth :: Int
- objectHeight :: Int
- objectName :: String
- objectType :: String
- objectProperties :: Map Text Text
- objectVisible :: Bool
- objectX :: Int
- objectY :: Int
- objectRotation :: Float
- objectGid :: GlobalId
- objectEllipse :: Bool
- objectPolygon :: Vector (Int, Int)
- objectPolyline :: Vector (Int, Int)
- objectText :: Map Text Text
- data Layer = Layer {
- layerWidth :: Int
- layerHeight :: Int
- layerName :: String
- layerType :: String
- layerVisible :: Bool
- layerX :: Int
- layerY :: Int
- layerData :: Maybe (Vector GlobalId)
- layerObjects :: Maybe (Vector Object)
- layerProperties :: Map Text Text
- layerOpacity :: Float
- layerDraworder :: String
- data Terrain = Terrain {}
- data Frame = Frame {}
- data Tile = Tile {}
- data Tileset = Tileset {
- tilesetFirstgid :: GlobalId
- tilesetImage :: String
- tilesetName :: String
- tilesetTilewidth :: Int
- tilesetTileheight :: Int
- tilesetImagewidth :: Int
- tilesetImageheight :: Int
- tilesetProperties :: Map Text Text
- tilesetPropertytypes :: Map Text Text
- tilesetMargin :: Int
- tilesetSpacing :: Int
- tilesetTileproperties :: Map GlobalId (Map Text Text)
- tilesetTerrains :: Vector Terrain
- tilesetColumns :: Int
- tilesetTilecount :: Int
- tilesetTiles :: Map LocalId Tile
- newtype TransitiveTilesetMap = TransitiveTilesetMap (Map LocalId Value)
- parseTiles :: Object -> Parser (Map LocalId Tile)
- data Tiledmap = Tiledmap {
- tiledmapVersion :: Float
- tiledmapTiledversion :: String
- tiledmapWidth :: Int
- tiledmapHeight :: Int
- tiledmapTilewidth :: Int
- tiledmapTileheight :: Int
- tiledmapOrientation :: String
- tiledmapLayers :: Vector Layer
- tiledmapTilesets :: Vector Tileset
- tiledmapBackgroundcolor :: Maybe String
- tiledmapRenderorder :: String
- tiledmapProperties :: Map Text Text
- tiledmapNextobjectid :: Int
- loadTiledmap :: FilePath -> IO (Either String Tiledmap)
- module Data.Map
- module Data.Vector
Tiled map editor types, their aeson instances and map loading
A globally indexed identifier.
Constructors
GlobalId | |
Fields
|
A locally indexed identifier.
Constructors
Object | |
Fields
|
Constructors
Layer | |
Fields
|
Constructors
Terrain | |
Fields
|
Constructors
Frame | |
Fields
|
Constructors
Tile | |
Constructors
Tileset | |
Fields
|
newtype TransitiveTilesetMap Source #
Constructors
TransitiveTilesetMap (Map LocalId Value) |
The full monty.
Constructors
Tiledmap | |
Fields
|
loadTiledmap :: FilePath -> IO (Either String Tiledmap) Source #
Load a Tiled map from the given FilePath
.
Re-exports for working with Tiled types
module Data.Map
module Data.Vector