TMX TileMap 框架 SKTiledMap

码农软件 · 软件分类 · 常用工具包 · 2019-08-17 16:13:29

软件介绍

SKTiledMap 是用于 SpriteKit 的 TMX TileMap 框架。支持 iOS 8 和 OS X 10.10 及以上版本。

这是一个用于解析 Tiled Map Editor 产生的地图的库。

安装

  • Cocoapods

  1. pod 'SKTiledMap'

  2. Add #import <SKTiledMap/SKTiledMap.h> to your source file.

  • Manually

    1. Download the latest code version

    2. Open your project in Xcode, then drag and drop Framework/ folder  into your project

    3. configure Dependencies

    4. Add #import 'SKTiledMap.h' to your source file.

    基本用法

    SKTMMapLayer *mapLayer = [[SKTMMapLayer alloc] initWithContentsOfFile:@"map.tmx"];
    [self addChild:mapLayer];// get tile layerSKTMTileLayer *tileLayer = [mapLayer tileLayerWithName:@"Ground"];// get object layerSKTMObjectGroupLayer *objLayer = [mapLayer objectLayerWithName:@"Obj"];// get shape in object layerSKTMObjectGroupShape *heroObjShape = [objLayer shapeWithName:@"Hero"];// get custom properties[heroObjShape.model propertyForName:@"status"];// get image layerSKTMImageLayer *imgLayer = [mapLayer imageLayerWithName:@"Background"];// Coordinates System ConvertCGPoint tilePoint = [mapLayer.mapRenderer screenToTileCoords:CGPointMake(320, 600)];
    CGPoint mapPoint = [mapLayer.mapRenderer tileToScreenCoords:CGPointMake(1, 1)];// more detail you can see in demo or source code.

    特点:

    • All map types:

      • Orthogonal

      • Isometric

      • Isometric (staggered)

      • Hexagonal (staggered)

    • All TileLayerFormat:

      • XML

      • Base64 (uncompressed)

      • Base64 (gzip compressed)

      • Base64 (zlib compressed)

      • CSV

    • All Tile Render Ways:

      • Stagger Axis (X, Y)

      • Stagger Index (Odd, Even)

      • Tile Render Order (RightDown, RightUp, LeftDown, LeftUp)

      • Flipped/Rotated Tiles Or Objects

    • All ObjectGroup Shape

      • Rectangle

      • Ellipse

      • Polygon

      • Polyline

    • Animated tile support

    路线图

    请查看 TMX map format reference page.

    SKTiledMap(root)
    └── Framework
        │
        │-- SKTiledMap.h│
        ├── Model
        │   |-- TMXObject│   |-- TMXTile│   |-- TMXTileset│   |-- TMXTileLayer│   |-- TMXObjectGroupNode│   |-- TMXObjectGroup│   |-- TMXImageLayer│   |-- TMXMap│
        ├── Classes
        │   |-- SKMapRenderer│   |-- OrthogonalRenderer│   |-- IsometricRenderer│   |-- StaggeredRenderer│   |-- HexagonalRenderer│
        └── SpriteKitNode
            |-- SKTMNode|-- SKTMTileNode|-- SKTMObjectGroupTile|-- SKTMObjectGroupShape│
            |-- SKTMLayer|-- SKTMTileLayer|-- SKTMObjectGroupLayer|-- SKTMImageLayer|-- SKTMMapLayer

    SKTiledMap-Mac

    • iOS

    SKTiledMap



    本文地址:https://www.codercto.com/soft/d/12573.html

    MATLAB实用教程

    MATLAB实用教程

    穆尔(Holly Moore) / 高会生 刘童娜 李聪聪 / 电子工业出版社 / 2010-1-1 / 59.00元

    MATLAB实用教程(第二版),ISBN:9787121101793,作者:(美)穆尔 著,高会生,刘童娜,李聪聪 译一起来看看 《MATLAB实用教程》 这本书的介绍吧!

    随机密码生成器
    随机密码生成器

    多种字符组合密码

    SHA 加密
    SHA 加密

    SHA 加密工具

    RGB CMYK 转换工具
    RGB CMYK 转换工具

    RGB CMYK 互转工具