diff --git a/docs/quicktype/LdtkJson.cpp b/docs/quicktype/LdtkJson.cpp index 44776a052..9c027bcd5 100644 --- a/docs/quicktype/LdtkJson.cpp +++ b/docs/quicktype/LdtkJson.cpp @@ -470,7 +470,7 @@ namespace quicktype { }; /** - * An enum describing how the the Entity tile is rendered inside the Entity bounds. Possible + * An enum describing how the Entity tile is rendered inside the Entity bounds. Possible * values: `Cover`, `FitInside`, `Repeat`, `Stretch`, `FullSizeCropped`, * `FullSizeUncropped`, `NineSlice` */ @@ -709,7 +709,7 @@ namespace quicktype { void set_tile_rect(boost::optional value) { this->tile_rect = value; } /** - * An enum describing how the the Entity tile is rendered inside the Entity bounds. Possible + * An enum describing how the Entity tile is rendered inside the Entity bounds. Possible * values: `Cover`, `FitInside`, `Repeat`, `Stretch`, `FullSizeCropped`, * `FullSizeUncropped`, `NineSlice` */ @@ -4389,7 +4389,7 @@ namespace quicktype { case When::AFTER_SAVE: j = "AfterSave"; break; case When::BEFORE_SAVE: j = "BeforeSave"; break; case When::MANUAL: j = "Manual"; break; - default: throw std::runtime_error("This should not happen"); + default: throw std::runtime_error("Unexpected value in enumeration \"[object Object]\": " + std::to_string(static_cast(x))); } } @@ -4407,7 +4407,7 @@ namespace quicktype { case AllowedRefs::ONLY_SAME: j = "OnlySame"; break; case AllowedRefs::ONLY_SPECIFIC_ENTITY: j = "OnlySpecificEntity"; break; case AllowedRefs::ONLY_TAGS: j = "OnlyTags"; break; - default: throw std::runtime_error("This should not happen"); + default: throw std::runtime_error("Unexpected value in enumeration \"[object Object]\": " + std::to_string(static_cast(x))); } } @@ -4447,7 +4447,7 @@ namespace quicktype { case EditorDisplayMode::REF_LINK_BETWEEN_CENTERS: j = "RefLinkBetweenCenters"; break; case EditorDisplayMode::REF_LINK_BETWEEN_PIVOTS: j = "RefLinkBetweenPivots"; break; case EditorDisplayMode::VALUE_ONLY: j = "ValueOnly"; break; - default: throw std::runtime_error("This should not happen"); + default: throw std::runtime_error("Unexpected value in enumeration \"[object Object]\": " + std::to_string(static_cast(x))); } } @@ -4463,7 +4463,7 @@ namespace quicktype { case EditorDisplayPos::ABOVE: j = "Above"; break; case EditorDisplayPos::BENEATH: j = "Beneath"; break; case EditorDisplayPos::CENTER: j = "Center"; break; - default: throw std::runtime_error("This should not happen"); + default: throw std::runtime_error("Unexpected value in enumeration \"[object Object]\": " + std::to_string(static_cast(x))); } } @@ -4483,7 +4483,7 @@ namespace quicktype { case EditorLinkStyle::DASHED_LINE: j = "DashedLine"; break; case EditorLinkStyle::STRAIGHT_ARROW: j = "StraightArrow"; break; case EditorLinkStyle::ZIG_ZAG: j = "ZigZag"; break; - default: throw std::runtime_error("This should not happen"); + default: throw std::runtime_error("Unexpected value in enumeration \"[object Object]\": " + std::to_string(static_cast(x))); } } @@ -4513,7 +4513,7 @@ namespace quicktype { case TextLanguageMode::LANG_PYTHON: j = "LangPython"; break; case TextLanguageMode::LANG_RUBY: j = "LangRuby"; break; case TextLanguageMode::LANG_XML: j = "LangXml"; break; - default: throw std::runtime_error("This should not happen"); + default: throw std::runtime_error("Unexpected value in enumeration \"[object Object]\": " + std::to_string(static_cast(x))); } } @@ -4529,7 +4529,7 @@ namespace quicktype { case LimitBehavior::DISCARD_OLD_ONES: j = "DiscardOldOnes"; break; case LimitBehavior::MOVE_LAST_ONE: j = "MoveLastOne"; break; case LimitBehavior::PREVENT_ADDING: j = "PreventAdding"; break; - default: throw std::runtime_error("This should not happen"); + default: throw std::runtime_error("Unexpected value in enumeration \"[object Object]\": " + std::to_string(static_cast(x))); } } @@ -4545,7 +4545,7 @@ namespace quicktype { case LimitScope::PER_LAYER: j = "PerLayer"; break; case LimitScope::PER_LEVEL: j = "PerLevel"; break; case LimitScope::PER_WORLD: j = "PerWorld"; break; - default: throw std::runtime_error("This should not happen"); + default: throw std::runtime_error("Unexpected value in enumeration \"[object Object]\": " + std::to_string(static_cast(x))); } } @@ -4563,7 +4563,7 @@ namespace quicktype { case RenderMode::ELLIPSE: j = "Ellipse"; break; case RenderMode::RECTANGLE: j = "Rectangle"; break; case RenderMode::TILE: j = "Tile"; break; - default: throw std::runtime_error("This should not happen"); + default: throw std::runtime_error("Unexpected value in enumeration \"[object Object]\": " + std::to_string(static_cast(x))); } } @@ -4587,7 +4587,7 @@ namespace quicktype { case TileRenderMode::NINE_SLICE: j = "NineSlice"; break; case TileRenderMode::REPEAT: j = "Repeat"; break; case TileRenderMode::STRETCH: j = "Stretch"; break; - default: throw std::runtime_error("This should not happen"); + default: throw std::runtime_error("Unexpected value in enumeration \"[object Object]\": " + std::to_string(static_cast(x))); } } @@ -4603,7 +4603,7 @@ namespace quicktype { case Checker::HORIZONTAL: j = "Horizontal"; break; case Checker::NONE: j = "None"; break; case Checker::VERTICAL: j = "Vertical"; break; - default: throw std::runtime_error("This should not happen"); + default: throw std::runtime_error("Unexpected value in enumeration \"[object Object]\": " + std::to_string(static_cast(x))); } } @@ -4617,7 +4617,7 @@ namespace quicktype { switch (x) { case TileMode::SINGLE: j = "Single"; break; case TileMode::STAMP: j = "Stamp"; break; - default: throw std::runtime_error("This should not happen"); + default: throw std::runtime_error("Unexpected value in enumeration \"[object Object]\": " + std::to_string(static_cast(x))); } } @@ -4635,7 +4635,7 @@ namespace quicktype { case Type::ENTITIES: j = "Entities"; break; case Type::INT_GRID: j = "IntGrid"; break; case Type::TILES: j = "Tiles"; break; - default: throw std::runtime_error("This should not happen"); + default: throw std::runtime_error("Unexpected value in enumeration \"[object Object]\": " + std::to_string(static_cast(x))); } } @@ -4647,7 +4647,7 @@ namespace quicktype { inline void to_json(json & j, const EmbedAtlas & x) { switch (x) { case EmbedAtlas::LDTK_ICONS: j = "LdtkIcons"; break; - default: throw std::runtime_error("This should not happen"); + default: throw std::runtime_error("Unexpected value in enumeration \"[object Object]\": " + std::to_string(static_cast(x))); } } @@ -4671,7 +4671,7 @@ namespace quicktype { case Flag::MULTI_WORLDS: j = "MultiWorlds"; break; case Flag::PREPEND_INDEX_TO_LEVEL_FILE_NAMES: j = "PrependIndexToLevelFileNames"; break; case Flag::USE_MULTILINES_TYPE: j = "UseMultilinesType"; break; - default: throw std::runtime_error("This should not happen"); + default: throw std::runtime_error("Unexpected value in enumeration \"[object Object]\": " + std::to_string(static_cast(x))); } } @@ -4691,7 +4691,7 @@ namespace quicktype { case BgPos::COVER_DIRTY: j = "CoverDirty"; break; case BgPos::REPEAT: j = "Repeat"; break; case BgPos::UNSCALED: j = "Unscaled"; break; - default: throw std::runtime_error("This should not happen"); + default: throw std::runtime_error("Unexpected value in enumeration \"[object Object]\": " + std::to_string(static_cast(x))); } } @@ -4709,7 +4709,7 @@ namespace quicktype { case WorldLayout::GRID_VANIA: j = "GridVania"; break; case WorldLayout::LINEAR_HORIZONTAL: j = "LinearHorizontal"; break; case WorldLayout::LINEAR_VERTICAL: j = "LinearVertical"; break; - default: throw std::runtime_error("This should not happen"); + default: throw std::runtime_error("Unexpected value in enumeration \"[object Object]\": " + std::to_string(static_cast(x))); } } @@ -4727,7 +4727,7 @@ namespace quicktype { case IdentifierStyle::FREE: j = "Free"; break; case IdentifierStyle::LOWERCASE: j = "Lowercase"; break; case IdentifierStyle::UPPERCASE: j = "Uppercase"; break; - default: throw std::runtime_error("This should not happen"); + default: throw std::runtime_error("Unexpected value in enumeration \"[object Object]\": " + std::to_string(static_cast(x))); } } @@ -4745,7 +4745,7 @@ namespace quicktype { case ImageExportMode::NONE: j = "None"; break; case ImageExportMode::ONE_IMAGE_PER_LAYER: j = "OneImagePerLayer"; break; case ImageExportMode::ONE_IMAGE_PER_LEVEL: j = "OneImagePerLevel"; break; - default: throw std::runtime_error("This should not happen"); + default: throw std::runtime_error("Unexpected value in enumeration \"[object Object]\": " + std::to_string(static_cast(x))); } } } diff --git a/docs/quicktype/LdtkJson.cs b/docs/quicktype/LdtkJson.cs index b749d1342..7f4aadd84 100644 --- a/docs/quicktype/LdtkJson.cs +++ b/docs/quicktype/LdtkJson.cs @@ -526,7 +526,7 @@ public partial class EntityDefinition public TilesetRectangle TileRect { get; set; } /// - /// An enum describing how the the Entity tile is rendered inside the Entity bounds. Possible + /// An enum describing how the Entity tile is rendered inside the Entity bounds. Possible /// values: `Cover`, `FitInside`, `Repeat`, `Stretch`, `FullSizeCropped`, /// `FullSizeUncropped`, `NineSlice` /// @@ -2355,7 +2355,7 @@ public enum LimitScope { PerLayer, PerLevel, PerWorld }; public enum RenderMode { Cross, Ellipse, Rectangle, Tile }; /// - /// An enum describing how the the Entity tile is rendered inside the Entity bounds. Possible + /// An enum describing how the Entity tile is rendered inside the Entity bounds. Possible /// values: `Cover`, `FitInside`, `Repeat`, `Stretch`, `FullSizeCropped`, /// `FullSizeUncropped`, `NineSlice` /// diff --git a/docs/quicktype/LdtkJson.go b/docs/quicktype/LdtkJson.go index 5d83a1658..12f2a8cdd 100644 --- a/docs/quicktype/LdtkJson.go +++ b/docs/quicktype/LdtkJson.go @@ -39,7 +39,7 @@ type LdtkJSON struct { // If TRUE, an extra copy of the project will be created in a sub folder, when saving. BackupOnSave bool `json:"backupOnSave"` // Target relative path to store backup files - BackupRelPath *string `json:"backupRelPath,omitempty"` + BackupRelPath *string `json:"backupRelPath"` // Project background color BgColor string `json:"bgColor"` // An array of command lines that can be ran manually by the user @@ -55,11 +55,11 @@ type LdtkJSON struct { // **WARNING**: this field will move to the `worlds` array after the "multi-worlds" update. // It will then be `null`. You can enable the Multi-worlds advanced project option to enable // the change immediately.

Default new level height - DefaultLevelHeight *int64 `json:"defaultLevelHeight,omitempty"` + DefaultLevelHeight *int64 `json:"defaultLevelHeight"` // **WARNING**: this field will move to the `worlds` array after the "multi-worlds" update. // It will then be `null`. You can enable the Multi-worlds advanced project option to enable // the change immediately.

Default new level width - DefaultLevelWidth *int64 `json:"defaultLevelWidth,omitempty"` + DefaultLevelWidth *int64 `json:"defaultLevelWidth"` // Default X pivot (0 to 1) for new entities DefaultPivotX float64 `json:"defaultPivotX"` // Default Y pivot (0 to 1) for new entities @@ -72,7 +72,7 @@ type LdtkJSON struct { ExportLevelBg bool `json:"exportLevelBg"` // **WARNING**: this deprecated value is no longer exported since version 0.9.3 Replaced // by: `imageExportMode` - ExportPNG *bool `json:"exportPng,omitempty"` + ExportPNG *bool `json:"exportPng"` // If TRUE, a Tiled compatible file will also be generated along with the LDtk JSON file // (default is FALSE) ExportTiled bool `json:"exportTiled"` @@ -106,7 +106,7 @@ type LdtkJSON struct { // Next Unique integer ID available NextUid int64 `json:"nextUid"` // File naming pattern for exported PNGs - PNGFilePattern *string `json:"pngFilePattern,omitempty"` + PNGFilePattern *string `json:"pngFilePattern"` // If TRUE, a very simplified will be generated on saving, for quicker & easier engine // integration. SimplifiedExport bool `json:"simplifiedExport"` @@ -115,21 +115,21 @@ type LdtkJSON struct { Toc []LdtkTableOfContentEntry `json:"toc"` // This optional description is used by LDtk Samples to show up some informations and // instructions. - TutorialDesc *string `json:"tutorialDesc,omitempty"` + TutorialDesc *string `json:"tutorialDesc"` // **WARNING**: this field will move to the `worlds` array after the "multi-worlds" update. // It will then be `null`. You can enable the Multi-worlds advanced project option to enable // the change immediately.

Height of the world grid in pixels. - WorldGridHeight *int64 `json:"worldGridHeight,omitempty"` + WorldGridHeight *int64 `json:"worldGridHeight"` // **WARNING**: this field will move to the `worlds` array after the "multi-worlds" update. // It will then be `null`. You can enable the Multi-worlds advanced project option to enable // the change immediately.

Width of the world grid in pixels. - WorldGridWidth *int64 `json:"worldGridWidth,omitempty"` + WorldGridWidth *int64 `json:"worldGridWidth"` // **WARNING**: this field will move to the `worlds` array after the "multi-worlds" update. // It will then be `null`. You can enable the Multi-worlds advanced project option to enable // the change immediately.

An enum that describes how levels are organized in // this project (ie. linearly or in a 2D space). Possible values: <`null`>, `Free`, // `GridVania`, `LinearHorizontal`, `LinearVertical` - WorldLayout *WorldLayout `json:"worldLayout,omitempty"` + WorldLayout *WorldLayout `json:"worldLayout"` // This array will be empty, unless you enable the Multi-Worlds in the project advanced // settings.

- in current version, a LDtk project file can only contain a single // world with multiple levels in it. In this case, levels and world layout related settings @@ -178,7 +178,7 @@ type EntityDefinition struct { // Base entity color Color string `json:"color"` // User defined documentation for this element to provide help/tips to level designers. - Doc *string `json:"doc,omitempty"` + Doc *string `json:"doc"` // If enabled, all instances of this entity will be listed in the project "Table of content" // object. ExportToToc bool `json:"exportToToc"` @@ -202,13 +202,13 @@ type EntityDefinition struct { // Max instances count MaxCount int64 `json:"maxCount"` // Max pixel height (only applies if the entity is resizable on Y) - MaxHeight *int64 `json:"maxHeight,omitempty"` + MaxHeight *int64 `json:"maxHeight"` // Max pixel width (only applies if the entity is resizable on X) - MaxWidth *int64 `json:"maxWidth,omitempty"` + MaxWidth *int64 `json:"maxWidth"` // Min pixel height (only applies if the entity is resizable on Y) - MinHeight *int64 `json:"minHeight,omitempty"` + MinHeight *int64 `json:"minHeight"` // Min pixel width (only applies if the entity is resizable on X) - MinWidth *int64 `json:"minWidth,omitempty"` + MinWidth *int64 `json:"minWidth"` // An array of 4 dimensions for the up/right/down/left borders (in this order) when using // 9-slice mode for `tileRenderMode`.
If the tileRenderMode is not NineSlice, then // this array is empty.
See: https://en.wikipedia.org/wiki/9-slice_scaling @@ -229,20 +229,20 @@ type EntityDefinition struct { Tags []string `json:"tags"` // **WARNING**: this deprecated value is no longer exported since version 1.2.0 Replaced // by: `tileRect` - TileID *int64 `json:"tileId,omitempty"` + TileID *int64 `json:"tileId"` TileOpacity float64 `json:"tileOpacity"` // An object representing a rectangle from an existing Tileset - TileRect *TilesetRectangle `json:"tileRect,omitempty"` - // An enum describing how the the Entity tile is rendered inside the Entity bounds. Possible + TileRect *TilesetRectangle `json:"tileRect"` + // An enum describing how the Entity tile is rendered inside the Entity bounds. Possible // values: `Cover`, `FitInside`, `Repeat`, `Stretch`, `FullSizeCropped`, // `FullSizeUncropped`, `NineSlice` TileRenderMode TileRenderMode `json:"tileRenderMode"` // Tileset ID used for optional tile display - TilesetID *int64 `json:"tilesetId,omitempty"` + TilesetID *int64 `json:"tilesetId"` // Unique Int identifier Uid int64 `json:"uid"` // This tile overrides the one defined in `tileRect` in the UI - UITileRect *TilesetRectangle `json:"uiTileRect,omitempty"` + UITileRect *TilesetRectangle `json:"uiTileRect"` // Pixel width Width int64 `json:"width"` } @@ -258,28 +258,28 @@ type FieldDefinition struct { Type string `json:"__type"` // Optional list of accepted file extensions for FilePath value type. Includes the dot: // `.ext` - AcceptFileTypes []string `json:"acceptFileTypes,omitempty"` + AcceptFileTypes []string `json:"acceptFileTypes"` // Possible values: `Any`, `OnlySame`, `OnlyTags`, `OnlySpecificEntity` AllowedRefs AllowedRefs `json:"allowedRefs"` - AllowedRefsEntityUid *int64 `json:"allowedRefsEntityUid,omitempty"` + AllowedRefsEntityUid *int64 `json:"allowedRefsEntityUid"` AllowedRefTags []string `json:"allowedRefTags"` AllowOutOfLevelRef bool `json:"allowOutOfLevelRef"` // Array max length - ArrayMaxLength *int64 `json:"arrayMaxLength,omitempty"` + ArrayMaxLength *int64 `json:"arrayMaxLength"` // Array min length - ArrayMinLength *int64 `json:"arrayMinLength,omitempty"` + ArrayMinLength *int64 `json:"arrayMinLength"` AutoChainRef bool `json:"autoChainRef"` // TRUE if the value can be null. For arrays, TRUE means it can contain null values // (exception: array of Points can't have null values). CanBeNull bool `json:"canBeNull"` // Default value if selected value is null or invalid. - DefaultOverride interface{} `json:"defaultOverride,omitempty"` + DefaultOverride interface{} `json:"defaultOverride"` // User defined documentation for this field to provide help/tips to level designers about // accepted values. - Doc *string `json:"doc,omitempty"` + Doc *string `json:"doc"` EditorAlwaysShow bool `json:"editorAlwaysShow"` EditorCutLongValues bool `json:"editorCutLongValues"` - EditorDisplayColor *string `json:"editorDisplayColor,omitempty"` + EditorDisplayColor *string `json:"editorDisplayColor"` // Possible values: `Hidden`, `ValueOnly`, `NameAndValue`, `EntityTile`, `LevelTile`, // `Points`, `PointStar`, `PointPath`, `PointPathLoop`, `RadiusPx`, `RadiusGrid`, // `ArrayCountWithLabel`, `ArrayCountNoLabel`, `RefLinkBetweenPivots`, @@ -291,8 +291,8 @@ type FieldDefinition struct { // Possible values: `ZigZag`, `StraightArrow`, `CurvedArrow`, `ArrowsLine`, `DashedLine` EditorLinkStyle EditorLinkStyle `json:"editorLinkStyle"` EditorShowInWorld bool `json:"editorShowInWorld"` - EditorTextPrefix *string `json:"editorTextPrefix,omitempty"` - EditorTextSuffix *string `json:"editorTextSuffix,omitempty"` + EditorTextPrefix *string `json:"editorTextPrefix"` + EditorTextSuffix *string `json:"editorTextSuffix"` // If TRUE, the field value will be exported to the `toc` project JSON field. Only applies // to Entity fields. ExportToToc bool `json:"exportToToc"` @@ -301,20 +301,20 @@ type FieldDefinition struct { // TRUE if the value is an array of multiple values IsArray bool `json:"isArray"` // Max limit for value, if applicable - Max *float64 `json:"max,omitempty"` + Max *float64 `json:"max"` // Min limit for value, if applicable - Min *float64 `json:"min,omitempty"` + Min *float64 `json:"min"` // Optional regular expression that needs to be matched to accept values. Expected format: // `/some_reg_ex/g`, with optional "i" flag. - Regex *string `json:"regex,omitempty"` + Regex *string `json:"regex"` // If enabled, this field will be searchable through LDtk command palette Searchable bool `json:"searchable"` SymmetricalRef bool `json:"symmetricalRef"` // Possible values: <`null`>, `LangPython`, `LangRuby`, `LangJS`, `LangLua`, `LangC`, // `LangHaxe`, `LangMarkdown`, `LangJson`, `LangXml`, `LangLog` - TextLanguageMode *TextLanguageMode `json:"textLanguageMode,omitempty"` + TextLanguageMode *TextLanguageMode `json:"textLanguageMode"` // UID of the tileset used for a Tile - TilesetUid *int64 `json:"tilesetUid,omitempty"` + TilesetUid *int64 `json:"tilesetUid"` // Internal enum representing the possible field types. Possible values: F_Int, F_Float, // F_String, F_Text, F_Bool, F_Color, F_Enum(...), F_Point, F_Path, F_EntityRef, F_Tile FieldDefinitionType string `json:"type"` @@ -341,11 +341,11 @@ type TilesetRectangle struct { } type EnumDefinition struct { - ExternalFileChecksum *string `json:"externalFileChecksum,omitempty"` + ExternalFileChecksum *string `json:"externalFileChecksum"` // Relative path to the external file providing this Enum - ExternalRelPath *string `json:"externalRelPath,omitempty"` + ExternalRelPath *string `json:"externalRelPath"` // Tileset UID if provided - IconTilesetUid *int64 `json:"iconTilesetUid,omitempty"` + IconTilesetUid *int64 `json:"iconTilesetUid"` // User defined unique identifier Identifier string `json:"identifier"` // An array of user-defined tags to organize the Enums @@ -359,16 +359,16 @@ type EnumDefinition struct { type EnumValueDefinition struct { // **WARNING**: this deprecated value is no longer exported since version 1.4.0 Replaced // by: `tileRect` - TileSrcRect []int64 `json:"__tileSrcRect,omitempty"` + TileSrcRect []int64 `json:"__tileSrcRect"` // Optional color Color int64 `json:"color"` // Enum value ID string `json:"id"` // **WARNING**: this deprecated value is no longer exported since version 1.4.0 Replaced // by: `tileRect` - TileID *int64 `json:"tileId,omitempty"` + TileID *int64 `json:"tileId"` // Optional tileset rectangle to represents this value - TileRect *TilesetRectangle `json:"tileRect,omitempty"` + TileRect *TilesetRectangle `json:"tileRect"` } type LayerDefinition struct { @@ -376,18 +376,18 @@ type LayerDefinition struct { Type string `json:"__type"` // Contains all the auto-layer rule definitions. AutoRuleGroups []AutoLayerRuleGroup `json:"autoRuleGroups"` - AutoSourceLayerDefUid *int64 `json:"autoSourceLayerDefUid,omitempty"` + AutoSourceLayerDefUid *int64 `json:"autoSourceLayerDefUid"` // **WARNING**: this deprecated value is no longer exported since version 1.2.0 Replaced // by: `tilesetDefUid` - AutoTilesetDefUid *int64 `json:"autoTilesetDefUid,omitempty"` - AutoTilesKilledByOtherLayerUid *int64 `json:"autoTilesKilledByOtherLayerUid,omitempty"` - BiomeFieldUid *int64 `json:"biomeFieldUid,omitempty"` + AutoTilesetDefUid *int64 `json:"autoTilesetDefUid"` + AutoTilesKilledByOtherLayerUid *int64 `json:"autoTilesKilledByOtherLayerUid"` + BiomeFieldUid *int64 `json:"biomeFieldUid"` // Allow editor selections when the layer is not currently active. CanSelectWhenInactive bool `json:"canSelectWhenInactive"` // Opacity of the layer (0 to 1.0) DisplayOpacity float64 `json:"displayOpacity"` // User defined documentation for this element to provide help/tips to level designers. - Doc *string `json:"doc,omitempty"` + Doc *string `json:"doc"` // An array of tags to forbid some Entities in this layer ExcludedTags []string `json:"excludedTags"` // Width and height of the grid in pixels @@ -438,12 +438,12 @@ type LayerDefinition struct { // **WARNING**: some layer *instances* might use a different tileset. So most of the time, // you should probably use the `__tilesetDefUid` value found in layer instances.
Note: // since version 1.0.0, the old `autoTilesetDefUid` was removed and merged into this value. - TilesetDefUid *int64 `json:"tilesetDefUid,omitempty"` + TilesetDefUid *int64 `json:"tilesetDefUid"` // Type of the layer as Haxe Enum Possible values: `IntGrid`, `Entities`, `Tiles`, // `AutoLayer` LayerDefinitionType Type `json:"type"` // User defined color for the UI - UIColor *string `json:"uiColor,omitempty"` + UIColor *string `json:"uiColor"` // Unique Int identifier Uid int64 `json:"uid"` // Display tags @@ -456,9 +456,9 @@ type AutoLayerRuleGroup struct { Active bool `json:"active"` BiomeRequirementMode int64 `json:"biomeRequirementMode"` // *This field was removed in 1.0.0 and should no longer be used.* - Collapsed *bool `json:"collapsed,omitempty"` - Color *string `json:"color,omitempty"` - Icon *TilesetRectangle `json:"icon,omitempty"` + Collapsed *bool `json:"collapsed"` + Color *string `json:"color"` + Icon *TilesetRectangle `json:"icon"` IsOptional bool `json:"isOptional"` Name string `json:"name"` RequiredBiomeValues []string `json:"requiredBiomeValues"` @@ -488,7 +488,7 @@ type AutoLayerRuleDefinition struct { // If TRUE, then the rule should be re-evaluated by the editor at one point Invalidated bool `json:"invalidated"` // Default IntGrid value when checking cells outside of level bounds - OutOfBoundsValue *int64 `json:"outOfBoundsValue,omitempty"` + OutOfBoundsValue *int64 `json:"outOfBoundsValue"` // Rule pattern (size x size) Pattern []int64 `json:"pattern"` // If TRUE, enable Perlin filtering to only apply rule on specific random area @@ -504,7 +504,7 @@ type AutoLayerRuleDefinition struct { Size int64 `json:"size"` // **WARNING**: this deprecated value is no longer exported since version 1.5.0 Replaced // by: `tileRectsIds` - TileIDS []int64 `json:"tileIds,omitempty"` + TileIDS []int64 `json:"tileIds"` // Defines how tileIds array is used Possible values: `Single`, `Stamp` TileMode TileMode `json:"tileMode"` // Max random offset for X tile pos @@ -539,8 +539,8 @@ type IntGridValueDefinition struct { // Parent group identifier (0 if none) GroupUid int64 `json:"groupUid"` // User defined unique identifier - Identifier *string `json:"identifier,omitempty"` - Tile *TilesetRectangle `json:"tile,omitempty"` + Identifier *string `json:"identifier"` + Tile *TilesetRectangle `json:"tile"` // The IntGrid value itself Value int64 `json:"value"` } @@ -548,9 +548,9 @@ type IntGridValueDefinition struct { // IntGrid value group definition type IntGridValueGroupDefinition struct { // User defined color - Color *string `json:"color,omitempty"` + Color *string `json:"color"` // User defined string identifier - Identifier *string `json:"identifier,omitempty"` + Identifier *string `json:"identifier"` // Group unique ID Uid int64 `json:"uid"` } @@ -565,12 +565,12 @@ type TilesetDefinition struct { CWid int64 `json:"__cWid"` // The following data is used internally for various optimizations. It's always synced with // source image changes. - CachedPixelData map[string]interface{} `json:"cachedPixelData,omitempty"` + CachedPixelData map[string]interface{} `json:"cachedPixelData"` // An array of custom tile metadata CustomData []TileCustomMetadata `json:"customData"` // 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` - EmbedAtlas *EmbedAtlas `json:"embedAtlas,omitempty"` + EmbedAtlas *EmbedAtlas `json:"embedAtlas"` // 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. EnumTags []EnumTagValue `json:"enumTags"` @@ -584,7 +584,7 @@ type TilesetDefinition struct { PxWid int64 `json:"pxWid"` // 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. - RelPath *string `json:"relPath,omitempty"` + RelPath *string `json:"relPath"` // Array of group of tiles selections, only meant to be used in the editor SavedSelections []map[string]interface{} `json:"savedSelections"` // Space in pixels between all tiles @@ -592,7 +592,7 @@ type TilesetDefinition struct { // An array of user-defined tags to organize the Tilesets Tags []string `json:"tags"` // Optional Enum definition UID used for this tileset meta-data - TagsSourceEnumUid *int64 `json:"tagsSourceEnumUid,omitempty"` + TagsSourceEnumUid *int64 `json:"tagsSourceEnumUid"` TileGridSize int64 `json:"tileGridSize"` // Unique Intidentifier Uid int64 `json:"uid"` @@ -658,11 +658,11 @@ type EntityInstance struct { Tags []string `json:"__tags"` // Optional TilesetRect used to display this entity (it could either be the default Entity // tile, or some tile provided by a field value, like an Enum). - Tile *TilesetRectangle `json:"__tile,omitempty"` + Tile *TilesetRectangle `json:"__tile"` // X world coordinate in pixels. Only available in GridVania or Free world layouts. - WorldX *int64 `json:"__worldX,omitempty"` + WorldX *int64 `json:"__worldX"` // Y world coordinate in pixels Only available in GridVania or Free world layouts. - WorldY *int64 `json:"__worldY,omitempty"` + WorldY *int64 `json:"__worldY"` // Reference of the **Entity definition** UID DefUid int64 `json:"defUid"` // An array of all custom fields and their values. @@ -685,7 +685,7 @@ type FieldInstance struct { Identifier string `json:"__identifier"` // Optional TilesetRect used to display this field (this can be the field own Tile, or some // other Tile guessed from the value, like an Enum). - Tile *TilesetRectangle `json:"__tile,omitempty"` + Tile *TilesetRectangle `json:"__tile"` // Type of the field, such as `Int`, `Float`, `String`, `Enum(my_enum_name)`, `Bool`, // etc.
NOTE: if you enable the advanced option **Use Multilines type**, you will have // "*Multilines*" instead of "*String*" when relevant. @@ -752,9 +752,9 @@ type LayerInstance struct { // Total layer Y pixel offset, including both instance and definition offsets. PxTotalOffsetY int64 `json:"__pxTotalOffsetY"` // The definition UID of corresponding Tileset, if any. - TilesetDefUid *int64 `json:"__tilesetDefUid,omitempty"` + TilesetDefUid *int64 `json:"__tilesetDefUid"` // The relative path to corresponding Tileset, if any. - TilesetRelPath *string `json:"__tilesetRelPath,omitempty"` + TilesetRelPath *string `json:"__tilesetRelPath"` // Layer type (possible values: IntGrid, Entities, Tiles or AutoLayer) Type string `json:"__type"` // An array containing all tiles generated by Auto-layer rules. The array is already sorted @@ -768,7 +768,7 @@ type LayerInstance struct { Iid string `json:"iid"` // **WARNING**: this deprecated value is no longer exported since version 1.0.0 Replaced // by: `intGridCsv` - IntGrid []IntGridValueInstance `json:"intGrid,omitempty"` + IntGrid []IntGridValueInstance `json:"intGrid"` // A list of all values in the IntGrid layer, stored in CSV format (Comma Separated // Values).
Order is from left to right, and top to bottom (ie. first row from left to // right, followed by second row, etc).
`0` means "empty cell" and IntGrid values @@ -782,7 +782,7 @@ type LayerInstance struct { // instance. OptionalRules []int64 `json:"optionalRules"` // This layer can use another tileset by overriding the tileset UID here. - OverrideTilesetUid *int64 `json:"overrideTilesetUid,omitempty"` + OverrideTilesetUid *int64 `json:"overrideTilesetUid"` // X offset in pixels to render this layer, usually 0 (IMPORTANT: this should be added to // the `LayerDef` optional offset, so you should probably prefer using `__pxTotalOffsetX` // which contains the total offset value) @@ -830,7 +830,7 @@ type Level struct { // automatically used here if its value is `null`) BgColor string `json:"__bgColor"` // Position informations of the background image, if there is one. - BgPos *LevelBackgroundPosition `json:"__bgPos,omitempty"` + BgPos *LevelBackgroundPosition `json:"__bgPos"` // An array listing all other levels touching this one on the world map. Since 1.4.0, this // includes levels that overlap in the same world layer, or in nearby world layers.
// Only relevant for world layouts where level spatial positioning is manual (ie. GridVania, @@ -841,7 +841,7 @@ type Level struct { SmartColor string `json:"__smartColor"` // Background color of the level. If `null`, the project `defaultLevelBgColor` should be // used. - LevelBgColor *string `json:"bgColor,omitempty"` + LevelBgColor *string `json:"bgColor"` // Background image X pivot (0-1) BgPivotX float64 `json:"bgPivotX"` // Background image Y pivot (0-1) @@ -849,12 +849,12 @@ type Level struct { // An enum defining the way the background image (if any) is positioned on the level. See // `__bgPos` for resulting position info. Possible values: <`null`>, `Unscaled`, // `Contain`, `Cover`, `CoverDirty`, `Repeat` - LevelBgPos *BgPos `json:"bgPos,omitempty"` + LevelBgPos *BgPos `json:"bgPos"` // The *optional* relative path to the level background image. - BgRelPath *string `json:"bgRelPath,omitempty"` + BgRelPath *string `json:"bgRelPath"` // This value is not null if the project option "*Save levels separately*" is enabled. In // this case, this **relative** path points to the level Json file. - ExternalRelPath *string `json:"externalRelPath,omitempty"` + ExternalRelPath *string `json:"externalRelPath"` // An array containing this level custom field values. FieldInstances []FieldInstance `json:"fieldInstances"` // User defined unique identifier @@ -864,7 +864,7 @@ type Level struct { // An array containing all Layer instances. **IMPORTANT**: if the project option "*Save // levels separately*" is enabled, this field will be `null`.
This array is **sorted // in display order**: the 1st layer is the top-most and the last is behind. - LayerInstances []LayerInstance `json:"layerInstances,omitempty"` + LayerInstances []LayerInstance `json:"layerInstances"` // Height of the level in pixels PxHei int64 `json:"pxHei"` // Width of the level in pixels @@ -915,7 +915,7 @@ type NeighbourLevel struct { LevelIid string `json:"levelIid"` // **WARNING**: this deprecated value is no longer exported since version 1.2.0 Replaced // by: `levelIid` - LevelUid *int64 `json:"levelUid,omitempty"` + LevelUid *int64 `json:"levelUid"` } type LdtkTableOfContentEntry struct { @@ -1071,7 +1071,7 @@ const ( Tile RenderMode = "Tile" ) -// An enum describing how the the Entity tile is rendered inside the Entity bounds. Possible +// An enum describing how the Entity tile is rendered inside the Entity bounds. Possible // values: `Cover`, `FitInside`, `Repeat`, `Stretch`, `FullSizeCropped`, // `FullSizeUncropped`, `NineSlice` type TileRenderMode string diff --git a/docs/quicktype/LdtkJson.py b/docs/quicktype/LdtkJson.py index cb758f517..ccd9a365c 100644 --- a/docs/quicktype/LdtkJson.py +++ b/docs/quicktype/LdtkJson.py @@ -51,7 +51,7 @@ def from_float(x: Any) -> float: def to_float(x: Any) -> float: - assert isinstance(x, float) + assert isinstance(x, (int, float)) return x @@ -67,6 +67,7 @@ def from_dict(f: Callable[[Any], T], x: Any) -> Dict[str, T]: class When(Enum): """Possible values: `Manual`, `AfterLoad`, `BeforeSave`, `AfterSave`""" + AFTER_LOAD = "AfterLoad" AFTER_SAVE = "AfterSave" BEFORE_SAVE = "BeforeSave" @@ -98,6 +99,7 @@ def to_dict(self) -> dict: class AllowedRefs(Enum): """Possible values: `Any`, `OnlySame`, `OnlyTags`, `OnlySpecificEntity`""" + ANY = "Any" ONLY_SAME = "OnlySame" ONLY_SPECIFIC_ENTITY = "OnlySpecificEntity" @@ -129,6 +131,7 @@ class EditorDisplayMode(Enum): class EditorDisplayPos(Enum): """Possible values: `Above`, `Center`, `Beneath`""" + ABOVE = "Above" BENEATH = "Beneath" CENTER = "Center" @@ -136,6 +139,7 @@ class EditorDisplayPos(Enum): class EditorLinkStyle(Enum): """Possible values: `ZigZag`, `StraightArrow`, `CurvedArrow`, `ArrowsLine`, `DashedLine`""" + ARROWS_LINE = "ArrowsLine" CURVED_ARROW = "CurvedArrow" DASHED_LINE = "DashedLine" @@ -173,13 +177,16 @@ class FieldDefinition: """ allowed_refs: AllowedRefs """Possible values: `Any`, `OnlySame`, `OnlyTags`, `OnlySpecificEntity`""" + allowed_refs_entity_uid: Optional[int] allowed_ref_tags: List[str] allow_out_of_level_ref: bool array_max_length: Optional[int] """Array max length""" + array_min_length: Optional[int] """Array min length""" + auto_chain_ref: bool can_be_null: bool """TRUE if the value can be null. For arrays, TRUE means it can contain null values @@ -187,6 +194,7 @@ class FieldDefinition: """ default_override: Any """Default value if selected value is null or invalid.""" + doc: Optional[str] """User defined documentation for this field to provide help/tips to level designers about accepted values. @@ -202,9 +210,11 @@ class FieldDefinition: """ editor_display_pos: EditorDisplayPos """Possible values: `Above`, `Center`, `Beneath`""" + editor_display_scale: float editor_link_style: EditorLinkStyle """Possible values: `ZigZag`, `StraightArrow`, `CurvedArrow`, `ArrowsLine`, `DashedLine`""" + editor_show_in_world: bool editor_text_prefix: Optional[str] editor_text_suffix: Optional[str] @@ -214,18 +224,23 @@ class FieldDefinition: """ identifier: str """User defined unique identifier""" + is_array: bool """TRUE if the value is an array of multiple values""" + max: Optional[float] """Max limit for value, if applicable""" + min: Optional[float] """Min limit for value, if applicable""" + regex: Optional[str] """Optional regular expression that needs to be matched to accept values. Expected format: `/some_reg_ex/g`, with optional "i" flag. """ searchable: bool """If enabled, this field will be searchable through LDtk command palette""" + symmetrical_ref: bool text_language_mode: Optional[TextLanguageMode] """Possible values: <`null`>, `LangPython`, `LangRuby`, `LangJS`, `LangLua`, `LangC`, @@ -233,12 +248,14 @@ class FieldDefinition: """ tileset_uid: Optional[int] """UID of the tileset used for a Tile""" + field_definition_type: str """Internal enum representing the possible field types. Possible values: F_Int, F_Float, F_String, F_Text, F_Bool, F_Color, F_Enum(...), F_Point, F_Path, F_EntityRef, F_Tile """ uid: int """Unique Int identifier""" + use_for_smart_color: bool """If TRUE, the color associated with this field will override the Entity or Level default color in the editor UI. For Enum fields, this would be the color associated to their @@ -378,6 +395,7 @@ def to_dict(self) -> dict: class LimitBehavior(Enum): """Possible values: `DiscardOldOnes`, `PreventAdding`, `MoveLastOne`""" + DISCARD_OLD_ONES = "DiscardOldOnes" MOVE_LAST_ONE = "MoveLastOne" PREVENT_ADDING = "PreventAdding" @@ -394,6 +412,7 @@ class LimitScope(Enum): class RenderMode(Enum): """Possible values: `Rectangle`, `Ellipse`, `Tile`, `Cross`""" + CROSS = "Cross" ELLIPSE = "Ellipse" RECTANGLE = "Rectangle" @@ -402,14 +421,19 @@ class RenderMode(Enum): class TilesetRectangle: """This object represents a custom sub rectangle in a Tileset image.""" + h: int """Height in pixels""" + tileset_uid: int """UID of the tileset""" + w: int """Width in pixels""" + x: int """X pixels coordinate of the top-left corner in the Tileset image""" + y: int """Y pixels coordinate of the top-left corner in the Tileset image""" @@ -441,7 +465,7 @@ def to_dict(self) -> dict: class TileRenderMode(Enum): - """An enum describing how the the Entity tile is rendered inside the Entity bounds. Possible + """An enum describing how the Entity tile is rendered inside the Entity bounds. Possible values: `Cover`, `FitInside`, `Repeat`, `Stretch`, `FullSizeCropped`, `FullSizeUncropped`, `NineSlice` """ @@ -457,28 +481,35 @@ class TileRenderMode(Enum): class EntityDefinition: allow_out_of_bounds: bool """If enabled, this entity is allowed to stay outside of the current level bounds""" + color: str """Base entity color""" + doc: Optional[str] """User defined documentation for this element to provide help/tips to level designers.""" + export_to_toc: bool """If enabled, all instances of this entity will be listed in the project "Table of content" object. """ field_defs: List[FieldDefinition] """Array of field definitions""" + fill_opacity: float height: int """Pixel height""" + hollow: bool identifier: str """User defined unique identifier""" + keep_aspect_ratio: bool """Only applies to entities resizable on both X/Y. If TRUE, the entity instance width/height will keep the same aspect ratio as the definition. """ limit_behavior: LimitBehavior """Possible values: `DiscardOldOnes`, `PreventAdding`, `MoveLastOne`""" + limit_scope: LimitScope """If TRUE, the maxCount is a "per world" limit, if FALSE, it's a "per level". Possible values: `PerLayer`, `PerLevel`, `PerWorld` @@ -486,14 +517,19 @@ class EntityDefinition: line_opacity: float max_count: int """Max instances count""" + max_height: Optional[int] """Max pixel height (only applies if the entity is resizable on Y)""" + max_width: Optional[int] """Max pixel width (only applies if the entity is resizable on X)""" + min_height: Optional[int] """Min pixel height (only applies if the entity is resizable on Y)""" + min_width: Optional[int] """Min pixel width (only applies if the entity is resizable on X)""" + nine_slice_borders: List[int] """An array of 4 dimensions for the up/right/down/left borders (in this order) when using 9-slice mode for `tileRenderMode`.
If the tileRenderMode is not NineSlice, then @@ -501,18 +537,25 @@ class EntityDefinition: """ pivot_x: float """Pivot X coordinate (from 0 to 1.0)""" + pivot_y: float """Pivot Y coordinate (from 0 to 1.0)""" + render_mode: RenderMode """Possible values: `Rectangle`, `Ellipse`, `Tile`, `Cross`""" + resizable_x: bool """If TRUE, the entity instances will be resizable horizontally""" + resizable_y: bool """If TRUE, the entity instances will be resizable vertically""" + show_name: bool """Display entity name in editor""" + tags: List[str] """An array of strings that classifies this entity""" + tile_id: Optional[int] """**WARNING**: this deprecated value is no longer exported since version 1.2.0 Replaced by: `tileRect` @@ -520,17 +563,21 @@ class EntityDefinition: tile_opacity: float tile_rect: Optional[TilesetRectangle] """An object representing a rectangle from an existing Tileset""" + tile_render_mode: TileRenderMode - """An enum describing how the the Entity tile is rendered inside the Entity bounds. Possible + """An enum describing how the Entity tile is rendered inside the Entity bounds. Possible values: `Cover`, `FitInside`, `Repeat`, `Stretch`, `FullSizeCropped`, `FullSizeUncropped`, `NineSlice` """ tileset_id: Optional[int] """Tileset ID used for optional tile display""" + uid: int """Unique Int identifier""" + ui_tile_rect: Optional[TilesetRectangle] """This tile overrides the one defined in `tileRect` in the UI""" + width: int """Pixel width""" @@ -664,8 +711,10 @@ class EnumValueDefinition: """ color: int """Optional color""" + id: str """Enum value""" + tile_id: Optional[int] """**WARNING**: this deprecated value is no longer exported since version 1.4.0 Replaced by: `tileRect` @@ -707,14 +756,19 @@ class EnumDefinition: external_file_checksum: Optional[str] external_rel_path: Optional[str] """Relative path to the external file providing this Enum""" + icon_tileset_uid: Optional[int] """Tileset UID if provided""" + identifier: str """User defined unique identifier""" + tags: List[str] """An array of user-defined tags to organize the Enums""" + uid: int """Unique Int identifier""" + values: List[EnumValueDefinition] """All possible enum values, with their optional Tile infos.""" @@ -756,6 +810,7 @@ def to_dict(self) -> dict: class Checker(Enum): """Checker mode Possible values: `None`, `Horizontal`, `Vertical`""" + HORIZONTAL = "Horizontal" NONE = "None" VERTICAL = "Vertical" @@ -763,6 +818,7 @@ class Checker(Enum): class TileMode(Enum): """Defines how tileIds array is used Possible values: `Single`, `Stamp`""" + SINGLE = "Single" STAMP = "Stamp" @@ -774,6 +830,7 @@ class AutoLayerRuleDefinition: """ active: bool """If FALSE, the rule effect isn't applied, and no tiles are generated.""" + alpha: float break_on_match: bool """When TRUE, the rule will prevent other rules to be applied in the same cell if it matches @@ -781,57 +838,80 @@ class AutoLayerRuleDefinition: """ chance: float """Chances for this rule to be applied (0 to 1)""" + checker: Checker """Checker mode Possible values: `None`, `Horizontal`, `Vertical`""" + flip_x: bool """If TRUE, allow rule to be matched by flipping its pattern horizontally""" + flip_y: bool """If TRUE, allow rule to be matched by flipping its pattern vertically""" + invalidated: bool """If TRUE, then the rule should be re-evaluated by the editor at one point""" + out_of_bounds_value: Optional[int] """Default IntGrid value when checking cells outside of level bounds""" + pattern: List[int] """Rule pattern (size x size)""" + perlin_active: bool """If TRUE, enable Perlin filtering to only apply rule on specific random area""" + perlin_octaves: float perlin_scale: float perlin_seed: float pivot_x: float """X pivot of a tile stamp (0-1)""" + pivot_y: float """Y pivot of a tile stamp (0-1)""" + size: int """Pattern width & height. Should only be 1,3,5 or 7.""" + tile_ids: Optional[List[int]] """**WARNING**: this deprecated value is no longer exported since version 1.5.0 Replaced by: `tileRectsIds` """ tile_mode: TileMode """Defines how tileIds array is used Possible values: `Single`, `Stamp`""" + tile_random_x_max: int """Max random offset for X tile pos""" + tile_random_x_min: int """Min random offset for X tile pos""" + tile_random_y_max: int """Max random offset for Y tile pos""" + tile_random_y_min: int """Min random offset for Y tile pos""" + tile_rects_ids: List[List[int]] """Array containing all the possible tile IDs rectangles (picked randomly).""" + tile_x_offset: int """Tile X offset""" + tile_y_offset: int """Tile Y offset""" + uid: int """Unique Int identifier""" + x_modulo: int """X cell coord modulo""" + x_offset: int """X cell start offset""" + y_modulo: int """Y cell coord modulo""" + y_offset: int """Y cell start offset""" @@ -947,6 +1027,7 @@ class AutoLayerRuleGroup: biome_requirement_mode: int collapsed: Optional[bool] """*This field was removed in 1.0.0 and should no longer be used.*""" + color: Optional[str] icon: Optional[TilesetRectangle] is_optional: bool @@ -1006,11 +1087,14 @@ def to_dict(self) -> dict: class IntGridValueDefinition: """IntGrid value definition""" + color: str group_uid: int """Parent group identifier (0 if none)""" + identifier: Optional[str] """User defined unique identifier""" + tile: Optional[TilesetRectangle] value: int """The IntGrid value itself""" @@ -1046,10 +1130,13 @@ def to_dict(self) -> dict: class IntGridValueGroupDefinition: """IntGrid value group definition""" + color: Optional[str] """User defined color""" + identifier: Optional[str] """User defined string identifier""" + uid: int """Group unique ID""" @@ -1089,8 +1176,10 @@ class TypeEnum(Enum): class LayerDefinition: type: str """Type of the layer (*IntGrid, Entities, Tiles or AutoLayer*)""" + auto_rule_groups: List[AutoLayerRuleGroup] """Contains all the auto-layer rule definitions.""" + auto_source_layer_def_uid: Optional[int] auto_tileset_def_uid: Optional[int] """**WARNING**: this deprecated value is no longer exported since version 1.2.0 Replaced @@ -1100,25 +1189,35 @@ class LayerDefinition: biome_field_uid: Optional[int] can_select_when_inactive: bool """Allow editor selections when the layer is not currently active.""" + display_opacity: float """Opacity of the layer (0 to 1.0)""" + doc: Optional[str] """User defined documentation for this element to provide help/tips to level designers.""" + excluded_tags: List[str] """An array of tags to forbid some Entities in this layer""" + grid_size: int """Width and height of the grid in pixels""" + guide_grid_hei: int """Height of the optional "guide" grid in pixels""" + guide_grid_wid: int """Width of the optional "guide" grid in pixels""" + hide_fields_when_inactive: bool hide_in_list: bool """Hide the layer from the list on the side of the editor view.""" + identifier: str """User defined unique identifier""" + inactive_opacity: float """Alpha of this layer when it is not the active one.""" + int_grid_values: List[IntGridValueDefinition] """An array that defines extra optional info for each IntGrid value.
WARNING: the array order is not related to actual IntGrid values! As user can re-order IntGrid values @@ -1126,6 +1225,7 @@ class LayerDefinition: """ int_grid_values_groups: List[IntGridValueGroupDefinition] """Group informations for IntGrid values""" + parallax_factor_x: float """Parallax horizontal factor (from -1 to 1, defaults to 0) which affects the scrolling speed of this layer, creating a fake 3D (parallax) effect. @@ -1136,6 +1236,7 @@ class LayerDefinition: """ parallax_scaling: bool """If true (default), a layer with a parallax factor will also be scaled up/down accordingly.""" + px_offset_x: int """X offset of the layer, in pixels (IMPORTANT: this should be added to the `LayerInstance` optional offset) @@ -1150,6 +1251,7 @@ class LayerDefinition: """ required_tags: List[str] """An array of tags to filter Entities that can be added to this layer""" + tile_pivot_x: float """If the tiles are smaller or larger than the layer grid, the pivot value will be used to position the tile relatively its grid cell. @@ -1170,10 +1272,13 @@ class LayerDefinition: """ ui_color: Optional[str] """User defined color for the UI""" + uid: int """Unique Int identifier""" + ui_filter_tags: List[str] """Display tags""" + use_async_render: bool """Asynchronous rendering option for large/complex layers""" @@ -1300,6 +1405,7 @@ def to_dict(self) -> dict: class TileCustomMetadata: """In a tileset definition, user defined meta-data of a tile.""" + data: str tile_id: int @@ -1327,6 +1433,7 @@ class EmbedAtlas(Enum): class EnumTagValue: """In a tileset definition, enum based tag infos""" + enum_value_id: str tile_ids: List[int] @@ -1355,14 +1462,17 @@ class TilesetDefinition: """ c_hei: int """Grid-based height""" + c_wid: int """Grid-based width""" + cached_pixel_data: Optional[Dict[str, Any]] """The following data is used internally for various optimizations. It's always synced with source image changes. """ custom_data: List[TileCustomMetadata] """An array of custom tile metadata""" + embed_atlas: Optional[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` @@ -1373,24 +1483,32 @@ class TilesetDefinition: """ identifier: str """User defined unique identifier""" + padding: int """Distance in pixels from image borders""" + px_hei: int """Image height in pixels""" + px_wid: int """Image width in pixels""" + rel_path: Optional[str] """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. """ saved_selections: List[Dict[str, Any]] """Array of group of tiles selections, only meant to be used in the editor""" + spacing: int """Space in pixels between all tiles""" + tags: List[str] """An array of user-defined tags to organize the Tilesets""" + tags_source_enum_uid: Optional[int] """Optional Enum definition UID used for this tileset meta-data""" + tile_grid_size: int uid: int """Unique Intidentifier""" @@ -1474,16 +1592,20 @@ class Definitions: """ entities: List[EntityDefinition] """All entities definitions, including their custom fields""" + enums: List[EnumDefinition] """All internal enums""" + external_enums: List[EnumDefinition] """Note: external enums are exactly the same as `enums`, except they have a `relPath` to point to an external source file. """ layers: List[LayerDefinition] """All layer definitions""" + level_fields: List[FieldDefinition] """All custom fields available to all levels.""" + tilesets: List[TilesetDefinition] """All tilesets""" @@ -1530,6 +1652,7 @@ class Flag(Enum): class FieldInstance: identifier: str """Field definition identifier""" + tile: Optional[TilesetRectangle] """Optional TilesetRect used to display this field (this can be the field own Tile, or some other Tile guessed from the value, like an Enum). @@ -1552,6 +1675,7 @@ class FieldInstance: """ def_uid: int """Reference of the **Field definition** UID""" + real_editor_values: List[Any] """Editor internal raw values""" @@ -1589,34 +1713,43 @@ def to_dict(self) -> dict: class EntityInstance: grid: List[int] """Grid-based coordinates (`[x,y]` format)""" + identifier: str """Entity definition identifier""" + pivot: List[float] """Pivot coordinates (`[x,y]` format, values are from 0 to 1) of the Entity""" + smart_color: str """The entity "smart" color, guessed from either Entity definition, or one its field instances. """ tags: List[str] """Array of tags defined in this Entity definition""" + tile: Optional[TilesetRectangle] """Optional TilesetRect used to display this entity (it could either be the default Entity tile, or some tile provided by a field value, like an Enum). """ world_x: Optional[int] """X world coordinate in pixels. Only available in GridVania or Free world layouts.""" + world_y: Optional[int] """Y world coordinate in pixels Only available in GridVania or Free world layouts.""" + def_uid: int """Reference of the **Entity definition** UID""" + field_instances: List[FieldInstance] """An array of all custom fields and their values.""" + height: int """Entity height in pixels. For non-resizable entities, it will be the same as Entity definition. """ iid: str """Unique instance identifier""" + px: List[int] """Pixel coordinates (`[x,y]` format) in current level coordinate space. Don't forget optional layer offsets, if they exist! @@ -1690,10 +1823,13 @@ class ReferenceToAnEntityInstance: """ entity_iid: str """IID of the refered EntityInstance""" + layer_iid: str """IID of the LayerInstance containing the refered EntityInstance""" + level_iid: str """IID of the Level containing the refered EntityInstance""" + world_iid: str """IID of the World containing the refered EntityInstance""" @@ -1723,8 +1859,10 @@ def to_dict(self) -> dict: class GridPoint: """This object is just a grid-based coordinate used in Field values.""" + cx: int """X grid-based coordinate""" + cy: int """Y grid-based coordinate""" @@ -1748,8 +1886,10 @@ def to_dict(self) -> dict: class IntGridValueInstance: """IntGrid value instance""" + coord_id: int """Coordinate ID in the layer grid""" + v: int """IntGrid value""" @@ -1773,8 +1913,10 @@ def to_dict(self) -> dict: class TileInstance: """This structure represents a single tile from a given Tileset.""" + a: float """Alpha/opacity of the tile (0-1, defaults to 1)""" + d: List[int] """Internal data used by the editor.
For auto-layer tiles: `[ruleId, coordId]`.
For tile-layer tiles: `[coordId]`. @@ -1790,6 +1932,7 @@ class TileInstance: """ src: List[int] """Pixel coordinates of the tile in the **tileset** (`[x,y]` format)""" + t: int """The *Tile ID* in the corresponding tileset.""" @@ -1826,24 +1969,34 @@ def to_dict(self) -> dict: class LayerInstance: c_hei: int """Grid-based height""" + c_wid: int """Grid-based width""" + grid_size: int """Grid size""" + identifier: str """Layer definition identifier""" + opacity: float """Layer opacity as Float [0-1]""" + px_total_offset_x: int """Total layer X pixel offset, including both instance and definition offsets.""" + px_total_offset_y: int """Total layer Y pixel offset, including both instance and definition offsets.""" + tileset_def_uid: Optional[int] """The definition UID of corresponding Tileset, if any.""" + tileset_rel_path: Optional[str] """The relative path to corresponding Tileset, if any.""" + type: str """Layer type (possible values: IntGrid, Entities, Tiles or AutoLayer)""" + auto_layer_tiles: List[TileInstance] """An array containing all tiles generated by Auto-layer rules. The array is already sorted in display order (ie. 1st tile is beneath 2nd, which is beneath 3rd etc.).

@@ -1854,6 +2007,7 @@ class LayerInstance: grid_tiles: List[TileInstance] iid: str """Unique layer instance identifier""" + int_grid: Optional[List[IntGridValueInstance]] """**WARNING**: this deprecated value is no longer exported since version 1.0.0 Replaced by: `intGridCsv` @@ -1866,14 +2020,17 @@ class LayerInstance: """ layer_def_uid: int """Reference the Layer definition UID""" + level_id: int """Reference to the UID of the level containing this layer instance""" + optional_rules: List[int] """An Array containing the UIDs of optional rules that were enabled in this specific layer instance. """ override_tileset_uid: Optional[int] """This layer can use another tileset by overriding the tileset UID here.""" + px_offset_x: int """X offset in pixels to render this layer, usually 0 (IMPORTANT: this should be added to the `LayerDef` optional offset, so you should probably prefer using `__pxTotalOffsetX` @@ -1886,6 +2043,7 @@ class LayerInstance: """ seed: int """Random seed used for Auto-Layers rendering""" + visible: bool """Layer instance visibility""" @@ -1979,6 +2137,7 @@ def to_dict(self) -> dict: class LevelBackgroundPosition: """Level background image position info""" + crop_rect: List[float] """An array of 4 float values describing the cropped sub-rectangle of the displayed background image. This cropping happens when original is larger than the level bounds. @@ -2024,6 +2183,7 @@ class BgPos(Enum): class NeighbourLevel: """Nearby level info""" + dir: str """A lowercase string tipping on the level location (`n`orth, `s`outh, `w`est, `e`ast).
Since 1.4.0, this value can also be `<` (neighbour depth is lower), `>` @@ -2033,6 +2193,7 @@ class NeighbourLevel: """ level_iid: str """Neighbour Instance Identifier""" + level_uid: Optional[int] """**WARNING**: this deprecated value is no longer exported since version 1.2.0 Replaced by: `levelIid` @@ -2076,6 +2237,7 @@ class Level: """ bg_pos: Optional[LevelBackgroundPosition] """Position informations of the background image, if there is one.""" + neighbours: List[NeighbourLevel] """An array listing all other levels touching this one on the world map. Since 1.4.0, this includes levels that overlap in the same world layer, or in nearby world layers.
@@ -2092,8 +2254,10 @@ class Level: """ bg_pivot_x: float """Background image X pivot (0-1)""" + bg_pivot_y: float """Background image Y pivot (0-1)""" + level_bg_pos: Optional[BgPos] """An enum defining the way the background image (if any) is positioned on the level. See `__bgPos` for resulting position info. Possible values: <`null`>, `Unscaled`, @@ -2101,16 +2265,20 @@ class Level: """ bg_rel_path: Optional[str] """The *optional* relative path to the level background image.""" + external_rel_path: Optional[str] """This value is not null if the project option "*Save levels separately*" is enabled. In this case, this **relative** path points to the level Json file. """ field_instances: List[FieldInstance] """An array containing this level custom field values.""" + identifier: str """User defined unique identifier""" + iid: str """Unique instance identifier""" + layer_instances: Optional[List[LayerInstance]] """An array containing all Layer instances. **IMPORTANT**: if the project option "*Save levels separately*" is enabled, this field will be `null`.
This array is **sorted @@ -2118,10 +2286,13 @@ class Level: """ px_hei: int """Height of the level in pixels""" + px_wid: int """Width of the level in pixels""" + uid: int """Unique Int identifier""" + use_auto_identifier: bool """If TRUE, the level identifier will always automatically use the naming pattern as defined in `Project.levelNamePattern`. Becomes FALSE if the identifier is manually modified by @@ -2232,6 +2403,7 @@ class LdtkTocInstanceData: hei_px: int iids: ReferenceToAnEntityInstance """IID information of this instance""" + wid_px: int world_x: int world_y: int @@ -2310,12 +2482,16 @@ class World: """ default_level_height: int """Default new level height""" + default_level_width: int """Default new level width""" + identifier: str """User defined unique identifier""" + iid: str """Unique instance identifer""" + levels: List[Level] """All levels from this world. The order of this array is only relevant in `LinearHorizontal` and `linearVertical` world layouts (see `worldLayout` value). @@ -2323,8 +2499,10 @@ class World: """ world_grid_height: int """Height of the world grid in pixels.""" + world_grid_width: int """Width of the world grid in pixels.""" + world_layout: Optional[WorldLayout] """An enum that describes how levels are organized in this project (ie. linearly or in a 2D space). Possible values: `Free`, `GridVania`, `LinearHorizontal`, `LinearVertical`, `null` @@ -2565,22 +2743,31 @@ class LdtkJSON: """ backup_limit: int """Number of backup files to keep, if the `backupOnSave` is TRUE""" + backup_on_save: bool """If TRUE, an extra copy of the project will be created in a sub folder, when saving.""" + backup_rel_path: Optional[str] """Target relative path to store backup files""" + bg_color: str """Project background color""" + custom_commands: List[LdtkCustomCommand] """An array of command lines that can be ran manually by the user""" + default_entity_height: int """Default height for new entities""" + default_entity_width: int """Default width for new entities""" + default_grid_size: int """Default grid size for new layers""" + default_level_bg_color: str """Default background color of levels""" + default_level_height: Optional[int] """**WARNING**: this field will move to the `worlds` array after the "multi-worlds" update. It will then be `null`. You can enable the Multi-worlds advanced project option to enable @@ -2593,14 +2780,19 @@ class LdtkJSON: """ default_pivot_x: float """Default X pivot (0 to 1) for new entities""" + default_pivot_y: float """Default Y pivot (0 to 1) for new entities""" + defs: Definitions """A structure containing all the definitions of this project""" + dummy_world_iid: str """If the project isn't in MultiWorlds mode, this is the IID of the internal "dummy" World.""" + export_level_bg: bool """If TRUE, the exported PNGs will include the level background (color or image).""" + export_png: Optional[bool] """**WARNING**: this deprecated value is no longer exported since version 0.9.3 Replaced by: `imageExportMode` @@ -2625,14 +2817,17 @@ class LdtkJSON: """ iid: str """Unique project identifier""" + image_export_mode: ImageExportMode """"Image export" option when saving project. Possible values: `None`, `OneImagePerLayer`, `OneImagePerLevel`, `LayersAndLevels` """ json_version: str """File format version""" + level_name_pattern: str """The default naming convention for level identifiers.""" + levels: List[Level] """All levels. The order of this array is only relevant in `LinearHorizontal` and `linearVertical` world layouts (see `worldLayout` value).
Otherwise, you should @@ -2644,8 +2839,10 @@ class LdtkJSON: """ next_uid: int """Next Unique integer ID available""" + png_file_pattern: Optional[str] """File naming pattern for exported PNGs""" + simplified_export: bool """If TRUE, a very simplified will be generated on saving, for quicker & easier engine integration. diff --git a/docs/quicktype/LdtkJson.rs b/docs/quicktype/LdtkJson.rs index 9732c8309..07202aae7 100644 --- a/docs/quicktype/LdtkJson.rs +++ b/docs/quicktype/LdtkJson.rs @@ -324,7 +324,7 @@ pub struct EntityDefinition { /// An object representing a rectangle from an existing Tileset pub tile_rect: Option, - /// An enum describing how the the Entity tile is rendered inside the Entity bounds. Possible + /// An enum describing how the Entity tile is rendered inside the Entity bounds. Possible /// values: `Cover`, `FitInside`, `Repeat`, `Stretch`, `FullSizeCropped`, /// `FullSizeUncropped`, `NineSlice` pub tile_render_mode: TileRenderMode, @@ -645,7 +645,7 @@ pub struct TilesetRectangle { pub y: i64, } -/// An enum describing how the the Entity tile is rendered inside the Entity bounds. Possible +/// An enum describing how the Entity tile is rendered inside the Entity bounds. Possible /// values: `Cover`, `FitInside`, `Repeat`, `Stretch`, `FullSizeCropped`, /// `FullSizeUncropped`, `NineSlice` #[derive(Debug, Clone, Serialize, Deserialize)]