Chroma Paint

Brush Texture2DExtensions TextureCoordinate

Brush


Description

A brush helps paint a nice clean brush swipe onto a texture, just as it does in real life. The way it works is in sessions, and can only be in one session at a time. So to get started, create a brush via calling it's default constructor. Next configure it's properties. And finally call the methods BeginSession (), UpdateSession (), and EndSession () respectively.

Properties

ImageTarget : Texture2D
Image to paint onto.

Color : Color
Color of brush to paint with.

Cookie : Texture2D
This is the shape image of the brush.

FillImage : Texture2D
The color image.

UseFillImage : bool
Determines wether the FillImage should be ignored or not.

LockAlpha : bool
Should the brush write to the Image's alpha channel.

Spacing : int
The number of pixels that the brush must travel before painting a new decal.

DragMode : bool
Check Unity Preferences for more info.

Size : int
Radius of the brush in pixels. Ranges from 1 to infinity.

InSession : bool
Returns wether the brush is currently painting or not.

CloneOffset : TextureCoordinate
The amount of offset to use when in Clone ToolMode.

PrecisionLevel : PrecisionMode
Check Unity Preferences for more info.


Methods

BeginPaintSession (ToolMode mode, TextureCoordinate position)
Begins the paint session at position.

UpdatePaintSession (TextureCoordinate position)
Updates the brushes location.

EndPaintSession ()
Ends the paint session, is a requirement before it can start painting again.


Constructors

Brush (int size, Color color, Texture2D imageTarget, Texture2D fillImage)
Brush ()
Brush (Texture2D imageTarget)
Brush (Texture2D imageTarget, Texture2D fillImage)