Line Brush
Contribution by : CraigGraff
This Brush draws a line of Tiles onto a Tilemap. With this Brush selected, click once to set the starting point of the line and click again at another position to set the ending point of the line. This Brush then draws a line of Tiles between the two points.
Use this as an example to create custom Brush behavior to make painting more efficient.
Properties
Property | Function |
---|---|
Line Start Active | Indicates whether the Line Brush has started drawing a line. |
Fill Gaps | Ensures that there are orthogonal connections between all Tiles that connect the start and end of the line. |
Line Start | The current starting point of the line. |
Usage
Select the Line Brush, then click once on a cell of the Tilemap to set the starting point of the line, then click on a second cell to set the ending point of the line. The Brush then draws the line of Tiles between the two set points. When the Line Brush is active, a blue outline will indicate the starting point of the line.
To have Tiles which are orthogonally connected from start to end, enable the Fill Gaps property in the Brush Editor.
Implementation
The Line Brush inherits from the Grid Brush and overrides the Paint
method to implement the line painting functionality.