BrushPaint.TilingTexture.Builder


public final class BrushPaint.TilingTexture.Builder


Builder for TilingTexture.

For Java developers, use TilingTexture.Builder to construct a TilingTexture with default values, overriding only as needed. For example: TilingTexture layer = TilingTexture.builder().setClientTextureId(id).setSizeX(width).setSizeY(height).build();

Summary

Public methods

final @NonNull BrushPaint.TilingTexture

Constructs a TilingTexture from this Builder.

final @NonNull BrushPaint.TilingTexture.Builder

Sets the blend mode used for blending this and all previous texture layers with the next one.

final @NonNull BrushPaint.TilingTexture.Builder
setClientTextureId(@NonNull String clientTextureId)

Sets the client texture ID for this texture layer.

final @NonNull BrushPaint.TilingTexture.Builder
setOffsetX(float offsetX)

Sets the horizontal offset of this texture layer, expressed as a fraction of the texture width.

final @NonNull BrushPaint.TilingTexture.Builder
setOffsetY(float offsetY)

Sets the vertical offset of this texture layer, expressed as a fraction of the texture height.

final @NonNull BrushPaint.TilingTexture.Builder

Sets the origin that should be used for positioning this texture layer.

final @NonNull BrushPaint.TilingTexture.Builder

Sets the rotation angle of this texture layer.

final @NonNull BrushPaint.TilingTexture.Builder

Sets the units in which this texture layer's width and height are measured.

final @NonNull BrushPaint.TilingTexture.Builder
setSizeX(
    @FloatRange(from = 0.0, fromInclusive = false, toInclusive = false) float sizeX
)

Sets the width of this texture layer, measured in the units specified by sizeUnit.

final @NonNull BrushPaint.TilingTexture.Builder
setSizeY(
    @FloatRange(from = 0.0, fromInclusive = false, toInclusive = false) float sizeY
)

Sets the height of this texture layer, measured in the units specified by sizeUnit.

final @NonNull BrushPaint.TilingTexture.Builder

Sets the horizontal wrapping mode for this texture layer.

final @NonNull BrushPaint.TilingTexture.Builder

Sets the vertical wrapping mode for this texture layer.

Public methods

build

Added in 1.1.0-alpha03
public final @NonNull BrushPaint.TilingTexture build()

Constructs a TilingTexture from this Builder.

Throws
IllegalStateException

if clientTextureId, sizeX, and/or sizeY were never set

setBlendMode

Added in 1.1.0-alpha03
public final @NonNull BrushPaint.TilingTexture.Builder setBlendMode(@NonNull BrushPaint.TextureLayer.BlendMode blendMode)

Sets the blend mode used for blending this and all previous texture layers with the next one.

setClientTextureId

Added in 1.1.0-alpha03
public final @NonNull BrushPaint.TilingTexture.Builder setClientTextureId(@NonNull String clientTextureId)

Sets the client texture ID for this texture layer.

setOffsetX

Added in 1.1.0-alpha03
public final @NonNull BrushPaint.TilingTexture.Builder setOffsetX(float offsetX)

Sets the horizontal offset of this texture layer, expressed as a fraction of the texture width.

setOffsetY

Added in 1.1.0-alpha03
public final @NonNull BrushPaint.TilingTexture.Builder setOffsetY(float offsetY)

Sets the vertical offset of this texture layer, expressed as a fraction of the texture height.

setOrigin

Added in 1.1.0-alpha03
public final @NonNull BrushPaint.TilingTexture.Builder setOrigin(@NonNull BrushPaint.TilingTexture.Origin origin)

Sets the origin that should be used for positioning this texture layer.

setRotationDegrees

Added in 1.1.0-alpha03
public final @NonNull BrushPaint.TilingTexture.Builder setRotationDegrees(@AngleDegreesFloat float degrees)

Sets the rotation angle of this texture layer.

setSizeUnit

Added in 1.1.0-alpha03
public final @NonNull BrushPaint.TilingTexture.Builder setSizeUnit(@NonNull BrushPaint.TextureLayer.SizeUnit sizeUnit)

Sets the units in which this texture layer's width and height are measured.

setSizeX

Added in 1.1.0-alpha03
public final @NonNull BrushPaint.TilingTexture.Builder setSizeX(
    @FloatRange(from = 0.0, fromInclusive = false, toInclusive = false) float sizeX
)

Sets the width of this texture layer, measured in the units specified by sizeUnit.

setSizeY

Added in 1.1.0-alpha03
public final @NonNull BrushPaint.TilingTexture.Builder setSizeY(
    @FloatRange(from = 0.0, fromInclusive = false, toInclusive = false) float sizeY
)

Sets the height of this texture layer, measured in the units specified by sizeUnit.

setWrapX

Added in 1.1.0-alpha03
public final @NonNull BrushPaint.TilingTexture.Builder setWrapX(@NonNull BrushPaint.TextureLayer.Wrap wrapX)

Sets the horizontal wrapping mode for this texture layer.

setWrapY

Added in 1.1.0-alpha03
public final @NonNull BrushPaint.TilingTexture.Builder setWrapY(@NonNull BrushPaint.TextureLayer.Wrap wrapY)

Sets the vertical wrapping mode for this texture layer.