Class DrawingEngine
- Namespace
- WitShells.CanvasDrawTool
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
LayerManager
public LayerManager LayerManager { get; }
Property Value
PrimaryColor
public Color PrimaryColor { get; }
Property Value
- Color
SecondaryColor
public Color SecondaryColor { get; }
Property Value
- Color
Settings
public DrawToolSettings Settings { get; }
Property Value
Methods
BeginDraw(Vector2, float)
Start drawing at a position.
public void BeginDraw(Vector2 canvasPosition, float pressure = 1)
Parameters
canvasPositionVector2pressurefloat
ContinueDraw(Vector2, float)
Continue drawing to a new position.
public void ContinueDraw(Vector2 canvasPosition, float pressure = 1)
Parameters
canvasPositionVector2pressurefloat
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
layerLayerObjectcenterVector2IntradiusXintradiusYintcolorColorfilledbool
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
layerLayerObjectstartVector2IntendVector2IntcolorColorthicknessint
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
layerLayerObjectminVector2IntmaxVector2IntcolorColorfilledboolthicknessint
EndDraw(Vector2, float)
End drawing.
public void EndDraw(Vector2 canvasPosition, float pressure = 1)
Parameters
canvasPositionVector2pressurefloat
FloodFill(LayerObject, Vector2Int, Color)
Flood fill from a starting point.
public void FloodFill(LayerObject layer, Vector2Int startPos, Color fillColor)
Parameters
layerLayerObjectstartPosVector2IntfillColorColor
RefreshFromSettings()
Refresh internal state from settings (called when settings change).
public void RefreshFromSettings()
SetBrush(Brush)
public void SetBrush(Brush brush)
Parameters
brushBrush
SetSettings(DrawToolSettings)
Set the settings ScriptableObject reference.
public void SetSettings(DrawToolSettings settings)
Parameters
settingsDrawToolSettings
SetTool(DrawTool)
Set the current tool.
public void SetTool(DrawingEngine.DrawTool tool)
Parameters
toolDrawingEngine.DrawTool