Introduction
Introduction to Painter
- Overview
- Nomenclature and Shortcuts
- Painter Window
- Basics
- Limitations
- Clipboard
- About The Icon
- Option Buttons and Status Display
- Tilemaps List
- Settings
Overview
Tile+Painter (Painter) is a different sort of Tilemap painting and editing tool.
Download the TilePlusPainter_QuickGuide.pdf and print it out if you like!
Just like the Unity Tilemap Editor (UTE) you can paint single tiles or groups of tiles from a Palette. Unlike the UTE, you can paint Prefabs, custom single- or multiple-Tilemap archives and perform complex transform modifications. There’s even a persistent Favorites list.
Painter is an UIElements-based editor window with three modes: Paint, Edit, and Grid.
Painting
In Paint mode, Painter presents lists of Tilemaps, and lists of Sources (including Unity Palettes, archived Tilemaps, and a Favorites List) rather than a Palette and Brushes. Select a map in the left column’s list and a source in the center column’s list, then a third list in the rightmost column presents the Objects (as in UnityEngine.Object) available to paint. Paintable Objects include tiles, tile Bundles, TileFabs, Prefabs, and Multiple-Selection “Picks.”
For Unity Palettes, the rightmost column can show the same display as the UTE.
Center Column Sources | What’s displayed | What’s painted on a Tilemap. |
---|---|---|
Unity Palette | A list of tiles or a standard Unity Tilemap Editor (UTE) view. | Single tiles or a selection from the Palette. |
TileFab | Information about the TileFab | All the tiles and Prefabs from the TileFab on one or more Tilemaps. |
Bundle | Information about the Bundle | All the tiles and Prefabs from the Bundle on one Tilemap. |
A list of tiles and Prefabs contained in the Bundle | Individual tiles and Prefabs | |
Favorites | A list of tiles, Prefabs, Picks or Bundles. | Individual tiles and Prefabs or groups of tiles from Picks or Bundles. |
Painter also supports selection of groups of tiles called “Picks” which are selections of tiles from within the Scene view or on a displayed Palette when the UTE is visible in Painter.
- Picks can be saved as Favorites or transformed into Bundles.
- Picks can be flipped and rotated as a group or as individual tiles (or both).
Edit
Edit mode is used to edit individual tiles.
- Click on a Tilemap in the leftmost list and the center list displays all the tiles on that Tilemap.
- Click on an individual tile, or Pick one from the scene, and you can edit it.
- Multiple-select several TilePlus tiles of the same Type from the center list.
- A special tool appears that lets you edit fields and overwrite those in the selected tiles.
Grid
Grid mode comprises utilities for creating, managing, viewing, and using Grid Selections in various ways.
Painting Sources
If you have existing Palettes, Painter can use those as sources of tiles to Paint, viewable as a list of tiles or as a Palette just like in the UTE.
You can also poke tiles, Prefabs, or Bundles into the Favorites List by context-clicking on a tile Asset, Prefab asset, or TpTileBundle asset in a Project Folder.
Since Painter is based on the Tile+Toolkit, you can paint ‘Tilemap Archives’ (formally known as TileFab and Bundle assets) just as easily as any single tile. Bundles’ archived tiles and Prefabs can be painted individually as well. The TilePlus User Guide explains how to create these special assets right within your scene, but you can also create Bundles in various ways using Painter.
Please read the FAQ at the end of this document, it may answer questions that you have.
Tile+Painter Tool
This appears in the Unity toolbar when a Tilemap is selected. If you click on the toolbar button the Painter window will open if it isn’t already open. It functions similarly to the Tile Palette toolbar button which will also appear when a Tilemap is selected. You don’t need to use it if you don’t want to.
Nomenclature and Shortcuts
Nomenclature
- “T+P” or “Painter” refers to TilePlus Painter. TPT refers to TilePlus Toolkit.
- “Unity Tilemap Editor” (UTE) refers to the Unity Tile Palette window.
- “Unity Palette” or “Palette” refers to the Palette prefabs that you create and manage with the UTE.
- “Multiple-Selection” or Multiple-Selection Picks” refers to selecting or using groups of tiles. Painter has extensive functionality for handling groups of tiles in single operations.
- “Marquee Shortcut” refers to the clutch shortcut used for drawing area in the Scene view. The default is ALT+1.
Shortcut Viewer
The Tileplus/Shortcut Viewer menu item displays a dockable window containing the Painter shortcuts. It’s handy when learning.
Changing Shortcuts
If you use the Shortcut Manager to change any of the Painter shortcuts, use the Refresh button at the lower-left corner of the Painter window to refresh the Action button shortcut hints seen when viewing their Tooltips.
Painter Modifiers
The TilePlus/Tile+Painter Modifiers menu item displays a window where you can create and edit custom transforms to be applied to single tiles or to groups of tiles both before and after placing the tiles on a Tilemap. See “Custom Modifiers.”
Default Shortcuts
PC
MAC
Painter Window
Mode Buttons
Painter has three modes: PAINT, EDIT, and GRID. These correspond to the Paintbrush, Tilemap, and Grid toolbar buttons at the top-left of the window. Notice that active Mode, Action, and Option buttons are highlighted with a line at the bottom of the button.
In PAINT mode you select a Tilemap in the left column, a source of Objects in the center column, then choose a single Object from the right column.
In EDIT mode you select a Tilemap in the left column and select a tile from a list of all the tiles for that Tilemap. The rightmost column displays the selected tile’s fields for TilePlus tiles or generic information for other tile types.
GRID mode is used to manage Grid Selections.
The red splitter bars can be used to arrange the different panels in any way that you like.
Basics
Action Buttons
These toggles are all active in Paint mode (as shown on the preceding page).
In Edit mode, only None, Pick, Help, and Settings are available. In Grid Selection mode only Help and Settings are available.
Button | Use | Default Shortcut (Win) |
---|---|---|
Off | Disengage Painter, cancels Move operation. | ALT+O |
Paint | Paint the tile in the Clipboard. | ALT+B |
Erase | Erase a tile | ALT+D |
Pick | Paint: Copy a single tile or drag a multiple selection from the Scene to the Clipboard or Favorites List. Edit: Select a single tile in the Scene for editing | ALT+I |
Move | Move a tile on the same Tilemap or to another Tilemap. | ALT+M |
Rotate CW | Rotate the sprite of a tile CW. | ALT+R |
Rotate CCW | Rotate the sprite of a tile CCW. | ALT+T |
Flip X | Flip the sprite of a tile on the Y axis. | ALT+X |
Flip Y | Flip the sprite of a tile on the X axis. | ALT+C |
Reset Transform | Reset the transform of a tile (remove rotation/flip, restore size) | ALT+Z |
Help | Displays some basic information. | None |
Settings | Tile+Toolkit and Tile+Painter settings. | None |
The default shortcut to change modes is ALT+Q.
When operating on multiple-tile selections, hold down SHIFT when Rotating or Flipping to rotate or flip the entire group of tiles. Alt-E or Shift-Alt-E will rotate the pivot of the multiple selection.
When using the Paint, Erase, Pick, or Move tools in Paint mode you can use the Marquee Shortcut (default is ALT+1) to draw out a boundary in the scene view. This lets you Paint, Erase, Pick, and Move areas of tiles.
Mouse Cursor
When the mouse cursor is over the Scene view window, it’s accompanied by a marquee highlighting the selected position. The Grid Position of the cursor is also displayed, along with textural hints about the operation.
Certain actions have optional functions controlled by the CTRL, SHIFT, or ALT keys.
The Settings panel’s Chunk Snapping settings also affect the display.
Previews and most of the text drawn in the scene only appear in 2D mode.
A ‘D’ appears when you hold down the Marquee shortcut and vanishes when you begin to drag out an area with the mouse.
Special Action Buttons
The Rotate, Flip, and Reset Transform actions have two uses:
It’s important to recognize the difference: the first live-edits tiles in the Tilemap after they’re placed. The second changes the transform of an Object (tiles/Prefabs/etc.) while being previewed prior to clicking on the Tilemap location where you want to place it.
When in Paint mode and previewing a multiple tile pick you can control what Rotate and Flip do with special shortcuts.
- Rotate or Flip shortcuts: the individual tiles in the pick will rotate independently.
- Alternate Rotate/Flip: (the defaults are the same keys with SHIFT held down) the entire Pick is affected.
- ALT+E or SHIFT+ALT+E rotates the Pivot of the Pick. This is something unique to Painter: the UTE doesn’t do this.
- ALT+Z will restore the original Pick.
UTE deals with Rotations and Flip only during preview. Painter also lets you change the transform of a tile without having to use an Inspector. For example, select the Rotate CW action button. If you click on a Tile while that Action button is selected the Tile’s sprite will rotate CW.
For tiles, these transform-modifying actions only work on tiles that are, or derive from, Unity Tiles (this includes all Tile+Toolkit tiles). Any tiles that derive from TileBase do not have a transform property. For example, these actions can’t work on Rule tiles or 2D Tilemap Extras’ AnimatedTiles since they derive from TileBase rather than Tile.
Modifying a transform during preview changes the small icon next to the clipboard to the Transform icon as an indicator.
Coders may be interested to know that rotations and flips of multiple-selection picks are done using a hidden GridBrush instance maintained in Painter. It’s not used for anything else, but this feature ensures that these operations will work in the same way as in the UTE.
Modifiers
Be sure to check out the “Modifiers” section. Custom transforms can be used to affect a tile or Prefab during preview: Position, Rotation, and Scale can all be affected. You can also set default transforms that apply to all tile and Prefab painting when appropriate. The Grid mode view has a button that can be used to apply modifiers to Grid Selections.
Limitations
Changing the transform or color of a tile requires the TileFlags to be set properly. If not, rotations, flips, and custom modifiers won’t work properly or may seem to work but placed tiles revert to their original state.
This is because even if you change the color or transform of a tile in the Tilemap (that’s how these changes on Color or transform work) if the Lock Color or Lock Transform flag bits are set then the next time that the Tilemap at that position is refreshed the color or transform of the Tilemap at that position will be restored to the data provided by the tile when its GetTileData method is called.
Depending on the situation, Painter may warn you of the problem. See the FAQ “I Can’t Paint Modified Tiles” in this document and read about the Utilities/Change Tile Flags menu command in TilePlus User Guide.
Examples:
- You paint a tile with the Lock Transform flag set and then use the Rotate action to rotate the placed tile on the Tilemap. It’ll appear to not work, or it may appear to work but revert at the next Tilemap refresh.
- You select a tile in Painter or multiple-select tiles from a Palette in Painter, then apply a modification but one or more of the tiles has the flags set improperly. Painter will present a dialog and won’t paint the tile(s).
Note : this limitation is due to the nature of Tilemaps and has nothing to do with Painter itself.
Clipboard
The Clipboard is in the upper-right corner of the Painter window and is only available in PAINT mode. It shows what sort of Object (as in UnityEngine.Object) is currently ready to Paint on a Tilemap.
Clipboard items are always UnityEngine.Object instances and thumbnail previews are shown if possible.
Clipboard items can be tiles, Prefabs, Bundles, TileFabs, or multiple-selection picks; but never GameObjects from the Scene hierarchy.
The Clipboard comprises several elements:
-
The “B” or Bundle Clipboard button creates a Bundle asset from the Clipboard content when the Clipboard contains a multiple-selection Pick. It’s disabled otherwise (as in the image above)
-
The “I” or Generate Icon button creates an Icon for a multiple-selection Pick. It’s disabled otherwise.
-
The “F” or Copy to Favorites button copies the Clipboard Object to Favorites. It’s disabled for TileFabs.
-
The “X” or Clear button clears the Clipboard.
-
Variety: X = empty, TilePlus Icon = TPT tiles, Tile Icon = normal Unity Tiles, eyedropper Icon = Picks, Prefabs Icon = Prefab; and TileFabs and Bundles use their custom asset class Icons.
- Any modifications to the Clipboard Object: Unity Transform Icon.
-
Thumbnail: An image representing the Object in the Clipboard.
- Tiles: The tile’s sprite or an alternative sprite (for tiles with Sprite properties).
- Prefabs: A Unity Asset Preview if possible, or a Prefab icon.
- TileFabs and Bundles: The asset’s embedded Icon or the class Icons for these Types.
- Multiple-selection Picks: an eyedropper or a pre-generated icon (see “About the Icon.”).
Click on the X to clear the Clipboard.
Use with Favorites List
An Icon is generated for the Pick. If you re-select this same Pick when viewing the Favorites list, then that icon will be shown in the Content box rather than an eyedropper. See “About the Icon” in the next section.
If you want to generate the Icon manually, click the I button. Note that the Icon is discarded if the Clipboard Content isn’t copied to Favorites.
Create Bundle from Pick
If a Multiple-selection Pick is in the clipboard, you can copy it into a Bundle by using the Tools/TilePlus/Bundle Clipboard menu command rather than the B button.
Cloned Tiles in Clipboard
If the Object in the Clipboard is a TilePlus tile picked from a Scene, then it must be a clone. Because of that, if you pick a clone tile from a Tilemap and repaint it anywhere that tile will be automatically re-cloned. This ensures that all TilePlus tiles are independent instances.
Similarly, if a Multiple-selection Pick is painted on a Tilemap and any TilePlus tiles are in the group of tiles which comprise the Pick, such TilePlus tiles will be automatically re-cloned.
Icon Warning
Please be aware that creating an Icon with the F or I button, can cause lengthy import activity depending on the state of the Unity Editor, the size of any textures or atlases, the readable status of any textures or atlases, how many sprites have been created from a sprite sheet, and whether ‘generate physics shape’ is ON, among other things. Usually, it takes less than a second.
About The Icon
(Yes this is repeated)
Please be aware that creating an Icon with the F or I button, can cause lengthy import activity depending on the state of the Unity Editor, the size of any textures or atlases, the readable status of any textures or atlases, how many sprites have been created from a sprite sheet, and whether ‘generate physics shape’ is ON, among other things. Usually, it takes less than a second.
About the Icon
Painter will try to create an icon for you when the Clipboard contains a multiple-selection Pick and you choose to create a Bundle or add the Pick to Favorites. A customized sprite packer is used to create a representative Icon (aka sprite) for the TpBundleTile.
This sprite packer scales all the selected tiles’ sprite textures to be the same size and packs them into a Texture in the same relative positions as the Grid Selection. It’s not a general-purpose sprite packer; the idea is to create something that gives you a visual cue for what will be painted.
- The output size ranges from 64 x 64 through 256 x 256 and may or may not be square.
- The packer takes a few seconds to operate due to importing activity. In some cases the delay can be significantly longer, depending on the state of the Unity Editor. See the FAQ for more information.
Note that if the source and/or sprite sheet texture isn’t set to readable then Painter will temporarily set the texture to readable. If there’s a code Exception (that is, a C# error appears in the console) then that texture might remain readable – there’s no way to be sure without looking.
You can always screenshot one of these Bundles after you paint it on a Tilemap and create a sprite to be used as an Icon using an image editor.
Notes:
- Tiles that are not based on Tile are not packed: no AnimatedTiles or Rule Tiles. This might change in the future. Null tiles or tiles without Sprites show as “?”.
- If there are greater than 512 usable sprites to pack, then packing is not performed and “?” is used instead.
Option Buttons and Status Display
Button | Effect |
---|---|
Refresh | Rescan all Tilemaps, delete and rebuild window contents. |
Update in Play | When ON, inspectors update in Play mode. |
AutoSave | When ON, auto-save the scene if TPT tiles are modified. |
Confirm Deletions | When ON, deleting tiles requires confirmation. |
Editor Selection Sync | When ON, selecting a Tilemap in the hierarchy selects it in the Painter window, and vice versa. This is backlit RED when the Painter ‘tool’ is activated. See below. |
Overwrite Protection | When ON, TilePlus tiles cannot be overwritten when Painting. Ignored in certain situations. |
Pick-to-Paint option | When ON in PAINT mode, a PICK will automatically change to PAINT. |
Show SGrid | When ON in PAINT mode, shows a marquee related to Chunk Size setting. |
Painter Exclusive | Mirrors the TilePlus Configuration Dialog’s “Painter Exclusive” setting. |
Palette | Opens the Unity Tilemap Editor |
P.T | Modifier window state. Click to open the Modifiers editor |
Activity Indicator | Status Information |
Painter Exclusive
If true then Painter has exclusive control in the Scene and using the Palette won't switch Editor Tools nor show on-screen text normally displayed by the Tile+Brush. Default is TRUE. This is a personal preference item.
P.T
The area to the right of the buttons contains the Default Transform and Activity indicators. The Default Transform indicator is clickable and will open the Painter Modifiers window if clicked. If a default transform for tiles is active, the lower-case p will change to an upper-case P. Similarly, if a default transform for Prefabs is active, the lower-case t will change to an upper-case T.
Activity Indicator
The Activity indicator shows the word “Active” when Painter is active, that is, ready to Paint or some other action in the Scene. When the mouse cursor is actually present in the Scene view window, the bottom edge of Painter’s window changes color to red.
If Drag-lock is ON (Ctrl is held down when Painting or Erasing or dragging out a marquee using the Marquee Shortcut) then that’s also shown here.
Customization
Note that the size of these and other UI buttons can be controlled with some of the sliders in Painter’s Settings pane.
Tilemaps List
The list of Tilemaps in the left column updates automatically when you add or delete Tilemaps in the editor or load/unload scenes.
If there’s more than one Grid in a Scene then the Grids’ names are prepended to the Tilemap names as shown here.
If there’s more than one scene in the hierarchy then the Tilemaps list prepends the name of the scene to the name of the Tilemap as shown here (the image also shows multiple Grids).
The list is sorted alphanumerically or by Sorting layer and order in layer. When sorting by layer/order is active you can choose to reverse the displayed order (see Settings).
If a Tilemap has any TPT tiles its name is bolded and the color is changed to cyan (or blue if not in Dark mode). If the Tilemap is in a Prefab, then the Prefab icon appears on the same line. If the Tilemap isn’t empty, the number of different types of tiles is shown on the same line.
All Actions which affect a Tilemap require a Tilemap selection.
- Except for Off, Help, and Settings, the function buttons are disabled if there’s no Tilemap selection.
- Off, Help, and Settings are always active.
- The center and right columns change depending on the selected Mode.
Hovering the mouse pointer over a Tilemap name will show the Sorting Layer name and the Order within layer. If the Z-position of the Tilemap’s GameObject is not zero, then that label will also display “+NZ”.
Help
At the top of this panel, you’ll find a button which opens the Shortcuts Viewer editor window. This dockable window displays all the Painter shortcuts that you’d see if you opened the Unity Editor shortcut configuration.
Settings
This displays settings for the Painter editor window, some of which are duplicated by the Option buttons at the bottom of the window.
Hide Info Messages: When checked, Painter won't show informational messages even if the Toolkit’s Configuration Dialog’s “Informational” messages checkbox is checked. Painter can generate a waterfall of info messages, most of which you don't care about.
Overwrite Protection: prevents you from overwriting already-painted TilePlus tiles.
Tilemap Sorting / Reverse Tilemap Sorting: controls how the Tilemaps are displayed in the left column.
- If both checkboxes are unchecked, then the Tilemaps are sorted in ascending alphanumeric order.
- If Tilemap Sorting is checked, then the list is sorted by Renderer sorting layer and then sorting order; in ascending order.
- Reversing the result can more accurately reflect the display of Tilemaps in the hierarchy window, if you prefer to arrange them in a certain order, so some tiles appear ‘in front of’ others.
Sync Selection: This option synchronizes changes in Tilemap selection between the Painter and the Hierarchy window. When ON, clicking on a Tilemap in the Hierarchy selects the same Tilemap in Painter, and vice versa. This is usually desirable, but if not, use the option button to turn this off.
The following only applies pre-Unity6 but included for historical reasons
If Sync Palettes is checked then the system forces synchronization of palettes between Painter and the UTE when both are open. Additionally, if this sync is active when the Painter window opens, Painter will use the current- or last-selected Palette from the UTE. When “Use Unity Palette” is checked in Paint mode, the “Sync Palettes” configuration setting is internally forced active (the configuration setting isn’t changed). If you use the UTE brush-select dropdown menu to select a brush that does not inherit from GridBrush (e.g., GameObject brush) the brush selection will revert to the Tile+Brush or the standard GridBrush. Note that when using Unity 6 the Sync Palettes option doesn’t appear in the Settings panel; it’s always ON.
Aggressive Selection: If checked, Painter looks for this situation: User changes the Editor’s selection from a Tilemap to something else then returns to a Tilemap: in that case, given proper conditions (i.e., valid Tilemap and if the previously selected Action (Paint, Erase, etc.) would affect a Tilemap), reactivate the Paint Tool.
If the Unity Tilemap Editor is open and has an active tool aggressive selection is automatically disabled.
See the Technical Note at the end of this document.
Scene Marquee and Scene Text Color: change the color of the Marquees and text drawn in the Scene view.
Show SGrid and SGrid Color display the SGrid: the higher-order grid whose size is determined by the Chunk Size setting in the Chunk-snapping section.
- When checked the 'SGrid' (the super-grid using the 'Chunk Size For Snapping' setting) is visible in the scene as a box around the cursor location.
- It's handy when using the layout system.
- The SGrid Color field can be used to customize the color.
- There's a new MiniButton at the bottom of the window that mirrors the setting.
- The SGrid isn’t shown if the Settings Panel Chunk Snapping toggle is on.
Highlight Time: How long tiles will be highlighted upon selection. This setting also controls the fadeout time for notifications that appear in the Scene view panel.
Update In Play: should be checked if you want Painter’s inspectors to update in Play mode.
- When unchecked, most of Painter (but not all) is inactive when the Editor is in Play mode. However, if you want to ensure that the operation of your app in Editor-Play mode is completely unaffected by Painter you should close the Painter window.
Validate Tilemaps in Play only appears when “Update in Play” is checked.
- Painter’s Hierarchy Change event tests to see if any Tilemaps have been added or deleted during play mode when this checkbox is ON.
- The checks are only needed if you are adding or deleting Tilemaps in Play mode.
- Note that if this is OFF and you add or delete Tilemaps in Play mode then:
- Deleted Tilemaps: when something on that map is being inspected in EDIT mode's right-hand column may cause null-ref errors.
- Similarly, if you are examining a Tile in the right-hand column but the map has been deleted then you can also get null-ref errors.
- See the “Updating In Play” topic for more information.
UI Size, Palette Sprite Size, List Font Size, and Toolbars relative size are used together to adjust the appearance of the Painter window UI.
- UI Size: adjusts the size of UI elements in Lists.
- Palette Sprite Size: adjusts the size of the sprite displayed in the rightmost column when a palette's contents are being displayed.
- List Font Size: adjusts the font size in lists. You can make the display look awful as the resultant display is also affected by the UI size and sprite size configuration settings.
- Toolbar Relative Size: adjusts the relative size of the top and bottom toolbars and the Clipboard. Click the Refresh button at the bottom of the Painter window to update the GUI.
Max #tiles to display: this value is used to limit the number of objects to display in a list; the default is 400 and the range is 50 through 9999.
- If the number of tiles in a Palette is > "Max # Tiles to Display" then the list is truncated and highlighted with a yellow border.
- Purpose: to avoid slowing down the Editor when huge palettes are encountered. Your author has encountered palettes with over 7000 tiles!
Chunk-Style TileFab Snapping
There are three settings related to Chunk Snapping. Please see the “Advanced TileFab Use” document for more information. Please note that if the Chunk Snapping toggle is on then the only Tools that can be activated are Paint and Erase. Also, the Painting Source List only shows the Favorites List and TileFabs that are:
- Chunks – and
- Match the Chunk Size choice that you made in Settings.
Note that when the Chunk Snapping toggle is on, TileFabs will always show in the center column even if the Show TileFabs checkbox is off in the center column’s Options subpanel.
When you toggle Chunk Snapping off, the Settings pane will close. This is by design as a refresh needs to occur.
Convenience Features
Reset Painter Settings: This unsurprisingly reset all settings to defaults. The window is rebuilt.
Open TilePlus Config dialog: This is the same as using Tools/TilePlus/Configuration Editor.
Reload: Perform a scripting reload after a short delay.