Rotorz Tile System Icon
Rotorz Tile System for Unity
API Reference
Available on the Unity Asset Store
TOC

PaintingUtility Class

Utility functions for painting tiles, lines of tiles, circles and squares. The editor tools included with this extension use this class to paint tiles though this class can also be used by custom scripts at runtime.
public static class PaintingUtility
public static class PaintingUtility

Methods

FloodFill(TileSystem, TileIndex, PaintingArgs)
Flood fill area of tile system.
FloodFill(TileSystem, TileIndex, PaintingArgs, IList<TileIndex>)
Flood fill area of tile system.
GetCircleIndices(IList<TileIndex>, TileIndex, Int32)
Get tile indices for filled circle of the specified radius.
GetCircleOutlineIndices(IList<TileIndex>, TileIndex, Int32)
Get tile indices for outline of circle of the specified radius.
GetLineIndices(IList<TileIndex>, TileIndex, TileIndex)
Get tile indices for line.
GetSquareIndices(IList<TileIndex>, TileIndex, Int32)
Get tile indices for filled square of the specified size.
GetSquareOutlineIndices(IList<TileIndex>, TileIndex, Int32)
Get tile indices for outline of circle of the specified size.
GetStrokeLineIndices(IList<TileIndex>, TileIndex, TileIndex, IList<TileIndex>)
Get tile indices for line stroked with the specified nozzle.
NormalizeLineEndPoints(TileIndex, TileIndex)
Normalize line endings so that 'from' refers to the upper-left most tile and 'to' refers to the lower-right most tile.
Paint(TileSystem, TileIndex, PaintingArgs)
Paint single tile at the specified index.
Paint(TileSystem, IList<TileIndex>, PaintingArgs)
Paint multiple tiles.
PaintCircle(TileSystem, TileIndex, Int32, PaintingArgs)
Paint filled circle of tiles of the specified radius.
PaintCircleOutline(TileSystem, TileIndex, Int32, PaintingArgs)
Paint outline of circle of tiles of the specified radius.
PaintLine(TileSystem, TileIndex, TileIndex, PaintingArgs)
Paint simple line of tiles.
PaintRectangle(TileSystem, TileIndex, TileIndex, Boolean, PaintingArgs)
Paint rectangle of tiles and optionally fill inner area.
PaintSquare(TileSystem, TileIndex, Int32, PaintingArgs)
Paint filled square of tiles of the specified size.
PaintSquareOutline(TileSystem, TileIndex, Int32, PaintingArgs)
Paint outline of square of tiles of the specified size.
StrokeLine(TileSystem, TileIndex, TileIndex, IList<TileIndex>, PaintingArgs)
Stroke line with custom nozzle shape.
StrokeLineWithCircle(TileSystem, TileIndex, TileIndex, Int32, PaintingArgs)
Stroke line with a circle nozzle shape.
StrokeLineWithSquare(TileSystem, TileIndex, TileIndex, Int32, PaintingArgs)
Stroke line with a square nozzle shape.

Properties

MaximumFillCount
Gets or sets the maximum number of tiles which can be painted when using FloodFill(TileSystem, TileIndex, PaintingArgs). This is a fail safe which can help to avoid crashing your game (or the Unity editor) when filling a large area. This does not apply when erasing tiles.

Events

ChunkCreated
Occurs when new chunk is created.
TilePainted
Occurs when a tile is painted using a brush.
WillEraseTile
Occurs when a tile will be erased. This event should not be used to paint new tiles.

Inheritance Hierarchy

System.Object
  Rotorz.Tile.PaintingUtility

See Also

Reference