Posted February 07, 2022 by Thorbjørn Lindeijer
#Release
Tiled 1.8 is here, bringing custom property types, configurable parallax origin, repeatable image layers, many scripting and AutoMapping improvements and a huge amount of fixes!
Tiled has always had a pretty flexible custom property system, allowing you to associate custom data with any of its data types. In this release, you can define your own types for these properties. They come in two forms for now: custom enums and custom classes.
Custom enums allow predefining a fixed set of valid values for a property. You can choose whether their value is stored as string or number, and you can choose whether to allow selecting a single value or multiple. When allowing multiple values and storing the value as number, bitflags will be used.
Suppose for example, that the “enemies” in your game can be either Neutral, Friendly or Aggressive. Now you can set up this enum in your project and you no longer have to remember the numbers or type those values!
Custom classes allow predefining a set of properties, with custom default values, which are always added as a unit. Maybe some of your objects have physics enabled, and when they do, you want to see all the relevant properties. Now you can!
As an added bonus, custom classes can use other custom classes as their members, any change you make to your custom enums or classes is immediately visible in the Properties view and changed properties are shown in bold and easy to unset again.
In Tiled 1.5, support was added for a parallax scrolling factor. In this release, we added a Parallax Origin property to each map, which can be used to set the camera location at which the parallax offset is 0. This can really help to match what you see in Tiled with what you see in your game. Also the handling of the parallax factor on group layers was fixed.
Somewhat related to parallax is the new support for repeating image layers. They provide a convenient way of set up an infinite repeating background. Of course, they’re also perfect for adding entirely custom grids. Talking about grids, the major grid can now be configured separately in the X and Y directions.
(demonstrating repeating image layers using Magic Cliffs Environment by Ansimuz)
Support for loading JavaScript modules has been added
(recognized by their .mjs extension), which allows splitting up your
extension in multiple files without polluting the global scope.
There’s a new File interface, providing various file system
operations. It is now also possible to open a map or tileset created from a
script in Tiled without first saving it to a file, by assigning it to
tiled.activeAsset. The region
type got a lot more useful.
These and many other small additions are included in the updated
tiled-api package, providing auto-completion and type checking
for Tiled extensions.
A number of quality-of-life improvements have been made to the AutoMapping system.
It is now possible to organize your rule maps using group layers, and using
group layers in your target maps also no longer breaks AutoMapping. The
regions layer can now be used alongside region_input/output layers for
defining shared regions. Layers in the rule map can be disabled by prefixing
their name with “//”.
Finally, a rule map can now be referenced directly from a Tiled project or
used by TileMap.autoMap, without needing a rules.txt
file.
The multi-layer painting behavior was much improved, such that it now also works when multiple layers have the same name. In the common case where you have the same number of layers selected as you are painting, it now only uses the layer order and not their names to determine which layers to modify. When it does need to use the names, it still also takes the order into account and will not paint more than once to the same layer.
On the tool side, when placing a tile object it can now be flipped or rotated before placing it. Also, the object context menu is now available while using the object creation tools. Finally, it is now much less likely to use the “Offset Layer” tool accidentally, thanks to improved logic for automatic switching of tools.
The undo behavior was improved such that tile selection changes no longer mark a file as modified. Also, subsequent edits to the same property no longer create multiple undo commands. And in many cases, undo commands are now automatically removed when they become “obsolete”, for example when making a layer visible and then invisible again.
Many other improvements and fixes could not be mentioned above. Here’s the full summary of the changes.
This new release was made possible by almost 300 patrons and sponsors supporting me on a monthly basis as well as many people choosing to pay for Tiled on itch.io and some who donated through Liberapay.
Your donations enable me to work full-time on Tiled! If you’re not donating yet, please consider setting up a small monthly donation to keep this sustainable. Let’s make this tool even better!