Classes
The following classes are available globally.
-
Projects are the primary entry point for
TiledKit
. The project represents the root of allMap
s andTileSet
s and the resources (such as images) that support them. The defaultProject
will use themain
Bundle as its root, making it very easy to include in a Swift Package Manager or Xcode module.let myMap = Project.default.get("mymap")
The above code will retrieve a file named ‘mymap.tmx’ from the root of the main
Bundle
. You may create instances ofProject
s that have a different root (such as an actual Tiled project directory, or differentBundle
) using the standard constructurs.Project
s are critical as they enable the relative processing of any resources referenced in the Tiled files and provide the key entry point for specializing TiledKit for a a specific game engine. Specializations only require the registration of a specificResourceLoader
for the type of object required by the game engine. See SKTiledKit for an example of a specialization.
See moreProject
s also provide resource caching capabilities, ensuring that the contents of anyURL
are loaded only once. If you add your ownResourceLoader
for types you can specify that if the created object should be cached or not.Declaration
Swift
public class Project
-
A
See moreTile
represents a 2D image that should be rendered when referenced on by anObject
orLayer
. It contains a reference to the image, and the portion of that image that should be used to generate the image.Declaration
Swift
public class Tile : Propertied, Equatable
-
Declaration
Swift
public class TileSet : Loadable, MutablePropertied