BrushCoat



A BrushCoat represents one coat of ink applied by a brush. It includes a BrushTip that describes the structure of that coat, and a non-empty list of possible BrushPaint objects - each one describes how to render the coat structure, and the one BrushPaint that is actually used is the first one in the list that is compatible with the device and renderer. Multiple BrushCoats can be combined within a single brush; when a stroke drawn by a multi-coat brush is rendered, each coat of ink will be drawn entirely atop the previous coat, even if the stroke crosses over itself, as though each coat were painted in its entirety one at a time.

Summary

Nested types

Builder for BrushCoat.

Public companion functions

BrushCoat.Builder

Returns a new BrushCoat.Builder.

Cmn

Public constructors

Creates a BrushCoat with the given paint and the default BrushTip.

Cmn
BrushCoat(tip: BrushTip, paint: BrushPaint)

Creates a BrushCoat with the given tip and paint.

Cmn
BrushCoat(tip: BrushTip, paintPreferences: @Size(min = 1) List<BrushPaint>)

Creates a BrushCoat with the given BrushTip and ordered preferences for BrushPaint.

Cmn

Public functions

BrushCoat
copy(tip: BrushTip, paintPreferences: @Size(min = 1) List<BrushPaint>)

Creates a copy of this and allows named properties to be altered while keeping the rest unchanged.

Cmn
open operator Boolean
equals(other: Any?)
Cmn
open Int
Cmn
BrushCoat.Builder

Returns a Builder with values set equivalent to this.

Cmn
open String
Cmn

Public properties

@Size(min = 1) List<BrushPaint>

An immutable list of the BrushPaint instances to try to use for rendering, in preference order.

Cmn
BrushTip

The tip used to apply the paint.

Cmn

Public companion functions

builder

fun builder(): BrushCoat.Builder

Returns a new BrushCoat.Builder.

Public constructors

BrushCoat

BrushCoat(paint: BrushPaint)

Creates a BrushCoat with the given paint and the default BrushTip.

Parameters
paint: BrushPaint

The paint to be applied for this coat.

BrushCoat

BrushCoat(tip: BrushTip, paint: BrushPaint)

Creates a BrushCoat with the given tip and paint.

Parameters
tip: BrushTip

The tip used to apply the paint.

paint: BrushPaint

The paint to be applied for this coat.

BrushCoat

BrushCoat(
    tip: BrushTip = BrushTip(),
    paintPreferences: @Size(min = 1) List<BrushPaint> = listOf(BrushPaint())
)

Creates a BrushCoat with the given BrushTip and ordered preferences for BrushPaint.

Parameters
tip: BrushTip = BrushTip()

The tip used to apply the paint.

paintPreferences: @Size(min = 1) List<BrushPaint> = listOf(BrushPaint())

The paint options to try to use for rendering, in preference order. The first one that is compatible with the renderer and the device will be used.

Public functions

copy

fun copy(
    tip: BrushTip = this.tip,
    paintPreferences: @Size(min = 1) List<BrushPaint> = this.paintPreferences
): BrushCoat

Creates a copy of this and allows named properties to be altered while keeping the rest unchanged.

Java callers should use Builder instead.

equals

open operator fun equals(other: Any?): Boolean

hashCode

open fun hashCode(): Int

toBuilder

fun toBuilder(): BrushCoat.Builder

Returns a Builder with values set equivalent to this. Java developers, use the returned builder to build a copy of a BrushCoat.

toString

open fun toString(): String

Public properties

paintPreferences

val paintPreferences: @Size(min = 1) List<BrushPaint>

An immutable list of the BrushPaint instances to try to use for rendering, in preference order. The first one that is compatible with the renderer and the device will be used. Compatibility may be determined by various parameters of a BrushPaint and its underlying BrushPaint.TextureLayer objects. Alternative paints add portability to brushes, so that fallback versions of strokes can be rendered on devices or renderers that have more limited functionality. If no paints are compatible, then this BrushCoat will not be rendered.

tip

val tipBrushTip

The tip used to apply the paint.