This sub-rectangle can be changed in the Tile Properties, or by scripts through the Tile.imageRect property. A new “Fill Mode” option was added to the tileset that can be either “Stretch” or “Preserve Aspect Ratio”.Īs a first step towards supporting sprite atlasses, the images in an Image Collection tileset can now refer to a sub-rectangle of their image. When a tile is not rendered at its native size, it used to always get stretched. The latter is useful if you want to use tiles with a different resolution but scale them up or down to fit the grid. The size at which all tiles in a tileset render can now be configured to be either the tile size (as before) or the map grid size. For consistency, this value is written out as “class” also for objects and tiles, but a project-wide compatibility option is provided to make it still write out as “type”: In addition, the “Type” property previously available only for objects and tiles is now available for all data types as the new “Class” property. If you used globally stored object types before, they can be manually imported to your project. If your project refers to an object types file, these types will be automatically imported as custom classes. This means custom classes can now have a color and can be used as “object type”. Object Types have been merged into the Property Types, now simply called “Custom Types”. In addition, all project-related settings are now only available after creating or loading a project. The project-related actions were simplified, with File > New > New Project replacing the Project > Save Project As action, and the “Recent Projects” and “Close Project” actions moving to the File menu as well. Talking about scripts, it is now possible to trigger a script from the command-line using the new -evaluate argument. This can greatly simplify the configuration of extensions, which previously might have relied on multiple prompts or reading custom properties. Thanks to scripted extensions can now build their own custom dialogs. Per-Rule OptionsĪ number of per-rule options can be set by placing a rectangle object on a “rule_options” layer that covers all the rules the options should apply to.Īny custom map, layer and object properties supported by Automapping are now displayed in the Properties view when it detects that the current map is an Automapping Rules map (the map needs to have at least one “input*” and one “output*” layer). It is also possible to set up your own tiles for these special cases. This tileset currently provides the following special tiles:įrom left to right, these are Empty, Ignore, NonEmpty, Other and Negate. ![]() To still enable the matching of “empty tile” or “non-empty tile” and other special cases, a built-in “Automapping Rules Tileset” was introduced, which can be added to your rules map from the Map menu. The input and output region of each rule are now automatically determined. To apply a certain set of rules only to some of your maps, you can now use filename filters in the rules.txt file. In addition, the “AutoMap While Drawing” option no longer creates separate undo steps, instead seamlessly integrating any changes with the paint operation. (a demonstration of AutoMapping by eishiya, where tile variations are chosen based on a “light” layer) Performance and UsabilityĪs a result of optimizations and taking advantage of multi-core CPUs, applying Automapping rules is now 10-30x faster and generally no longer causes noticeable delays. In this release the algorithm has been almost entirely rewritten, making it much faster, easier to set up and adding several new options. The Z key fills the map with zero-index tiles.This release comes with major improvements to Automapping, custom dialogs in scripts, a simplified project setup and a unified custom type system, among many other improvements! Let Automapping Work For YouĪutomapping, or pattern-based tile placement, was originally introduced in Tiled 0.6 to simplify editing of maps for The Mana World. The R key fills the map with random tiles. ![]() render () def _str_ ( self ): return f ' ' render () def set_random ( self ): n = len ( self. ![]() ![]() blit ( tile, ( j * 32, i * 32 )) def set_zero ( self ): self. shape for i in range ( m ): for j in range ( n ): tile = self. get_rect () def render ( self ): m, n = self. Surface (( 32 * w, 32 * h )) if rect : self. zeros ( size, dtype = int ) h, w = self. Class Tilemap : def _init_ ( self, tileset, size = ( 10, 20 ), rect = None ): self.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |