Table of Contents

Class DrawingEngine

Handles drawing operations on LayerObject. Uses DrawToolSettings ScriptableObject as single source of truth for brush settings. OPTIMIZED: Uses FastTextureBuffer for high-performance Android drawing.

public class DrawingEngine : MonoBehaviour
Inheritance
DrawingEngine

Properties

CurrentTool

public DrawingEngine.DrawTool CurrentTool { get; }

Property Value

DrawingEngine.DrawTool

LayerManager

public LayerManager LayerManager { get; }

Property Value

LayerManager

PrimaryColor

public Color PrimaryColor { get; }

Property Value

Color

SecondaryColor

public Color SecondaryColor { get; }

Property Value

Color

Settings

public DrawToolSettings Settings { get; }

Property Value

DrawToolSettings

Methods

BeginDraw(Vector2, float)

Start drawing at a position.

public void BeginDraw(Vector2 canvasPosition, float pressure = 1)

Parameters

canvasPosition Vector2
pressure float

ContinueDraw(Vector2, float)

Continue drawing to a new position.

public void ContinueDraw(Vector2 canvasPosition, float pressure = 1)

Parameters

canvasPosition Vector2
pressure float

DrawEllipse(LayerObject, Vector2Int, int, int, Color, bool)

Draw an ellipse.

public void DrawEllipse(LayerObject layer, Vector2Int center, int radiusX, int radiusY, Color color, bool filled)

Parameters

layer LayerObject
center Vector2Int
radiusX int
radiusY int
color Color
filled bool

DrawLine(LayerObject, Vector2Int, Vector2Int, Color, int)

Draw a line between two points.

public void DrawLine(LayerObject layer, Vector2Int start, Vector2Int end, Color color, int thickness)

Parameters

layer LayerObject
start Vector2Int
end Vector2Int
color Color
thickness int

DrawRectangle(LayerObject, Vector2Int, Vector2Int, Color, bool, int)

Draw a rectangle.

public void DrawRectangle(LayerObject layer, Vector2Int min, Vector2Int max, Color color, bool filled, int thickness)

Parameters

layer LayerObject
min Vector2Int
max Vector2Int
color Color
filled bool
thickness int

EndDraw(Vector2, float)

End drawing.

public void EndDraw(Vector2 canvasPosition, float pressure = 1)

Parameters

canvasPosition Vector2
pressure float

FloodFill(LayerObject, Vector2Int, Color)

Flood fill from a starting point.

public void FloodFill(LayerObject layer, Vector2Int startPos, Color fillColor)

Parameters

layer LayerObject
startPos Vector2Int
fillColor Color

RefreshFromSettings()

Refresh internal state from settings (called when settings change).

public void RefreshFromSettings()

SetBrush(Brush)

public void SetBrush(Brush brush)

Parameters

brush Brush

SetSettings(DrawToolSettings)

Set the settings ScriptableObject reference.

public void SetSettings(DrawToolSettings settings)

Parameters

settings DrawToolSettings

SetTool(DrawTool)

Set the current tool.

public void SetTool(DrawingEngine.DrawTool tool)

Parameters

tool DrawingEngine.DrawTool