Class TilesetDefinition
The Tileset definition is the most important part among project definitions. It
contains some extra informations about each integrated tileset. If you only had to parse
one definition section, that would be the one.
Properties
| Improve this Doc View SourceCachedPixelData
The following data is used internally for various optimizations. It's always synced with source image changes.
| Type | Description |
|---|---|
| System.Collections.Generic.Dictionary<System.String, System.Object> |
CHei
Grid-based height
| Type | Description |
|---|---|
| System.Int32 |
CustomData
An array of custom tile metadata
| Type | Description |
|---|---|
| LDtkUnity.TileCustomMetadata[] |
CWid
Grid-based width
| Type | Description |
|---|---|
| System.Int32 |
EmbedAtlas
If this value is set, then it means that this atlas uses an internal LDtk atlas image
instead of a loaded one. Possible values: <null>, LdtkIcons
| Type | Description |
|---|---|
| System.Nullable<LDtkUnity.EmbedAtlas> |
EnumTags
Tileset tags using Enum values specified by tagsSourceEnumId. This array contains 1
element per Enum value, which contains an array of all Tile IDs that are tagged with it.
| Type | Description |
|---|---|
| LDtkUnity.EnumTagValue[] |
Identifier
User defined unique identifier
| Type | Description |
|---|---|
| System.String |
IsEmbedAtlas
| Type | Description |
|---|---|
| System.Boolean | If this value is true, then it means that this definition uses an internal LDtk atlas image instead of a loaded one. |
Padding
Distance in pixels from image borders
| Type | Description |
|---|---|
| System.Int32 |
PxHei
Image height in pixels
| Type | Description |
|---|---|
| System.Int32 |
PxWid
Image width in pixels
| Type | Description |
|---|---|
| System.Int32 |
RelPath
Path to the source file, relative to the current project JSON file
It can be null
if no image was provided, or when using an embed atlas.
| Type | Description |
|---|---|
| System.String |
SavedSelections
Array of group of tiles selections, only meant to be used in the editor
| Type | Description |
|---|---|
| System.Collections.Generic.Dictionary<System.String, System.Object>[] |
Spacing
Space in pixels between all tiles
| Type | Description |
|---|---|
| System.Int32 |
Tags
An array of user-defined tags to organize the Tilesets
| Type | Description |
|---|---|
| System.String[] |
TagsSourceEnum
| Type | Description |
|---|---|
| EnumDefinition | Enum definition used for this tileset meta-data. |
TagsSourceEnumUid
Optional Enum definition UID used for this tileset meta-data
| Type | Description |
|---|---|
| System.Nullable<System.Int32> |
TileGridSize
| Type | Description |
|---|---|
| System.Int32 |
Uid
Unique Intidentifier
| Type | Description |
|---|---|
| System.Int32 |
UnityCSize
| Type | Description |
|---|---|
| UnityEngine.Vector2Int | Grid based size |
UnityPxSize
| Type | Description |
|---|---|
| UnityEngine.Vector2Int | Image size in pixels |
Methods
| Improve this Doc View SourceFromJson(String)
Used for deserializing ".ldtkt" files.
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | json | The LDtk json string to deserialize. |
Returns
| Type | Description |
|---|---|
| TilesetDefinition | The deserialized tileset definition. |
ToJson()
Returns
| Type | Description |
|---|---|
| System.Byte[] |