BrushPaint.TilingTexture



A texture layer that will repeat according to a 2D affine transformation of vertex positions. Each copy of the texture will have the same size and shape, modulo reflections.

Summary

Nested types

Builder for TilingTexture.

Specification of the origin point to use for the texture.

Public companion functions

BrushPaint.TilingTexture.Builder

Returns a new TilingTexture.Builder.

Cmn

Public constructors

TilingTexture(
    clientTextureId: String,
    sizeX: @FloatRange(from = 0.0, fromInclusive = false, toInclusive = false) Float,
    sizeY: @FloatRange(from = 0.0, fromInclusive = false, toInclusive = false) Float,
    offsetX: Float,
    offsetY: Float,
    rotationDegrees: @AngleDegreesFloat Float,
    sizeUnit: BrushPaint.TextureLayer.SizeUnit,
    origin: BrushPaint.TilingTexture.Origin,
    wrapX: BrushPaint.TextureLayer.Wrap,
    wrapY: BrushPaint.TextureLayer.Wrap,
    blendMode: BrushPaint.TextureLayer.BlendMode
)

Creates a new TilingTexture with the specified parameters.

Cmn

Public functions

BrushPaint.TilingTexture
copy(
    clientTextureId: String,
    sizeX: @FloatRange(from = 0.0, fromInclusive = false, toInclusive = false) Float,
    sizeY: @FloatRange(from = 0.0, fromInclusive = false, toInclusive = false) Float,
    offsetX: Float,
    offsetY: Float,
    rotationDegrees: @AngleDegreesFloat Float,
    sizeUnit: BrushPaint.TextureLayer.SizeUnit,
    origin: BrushPaint.TilingTexture.Origin,
    wrapX: BrushPaint.TextureLayer.Wrap,
    wrapY: BrushPaint.TextureLayer.Wrap,
    blendMode: BrushPaint.TextureLayer.BlendMode
)

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
BrushPaint.TilingTexture.Builder

Returns a Builder with values set equivalent to this.

Cmn
open String
Cmn

Public properties

String
Cmn
Float

The horizontal offset for the texture, specified as a fraction of the texture width.

Cmn
Float

The vertical offset for the texture, specified as a fraction of the texture height.

Cmn
BrushPaint.TilingTexture.Origin

The origin that will be used for positioning this texture layer.

Cmn
@AngleDegreesFloat Float

Angle specifying the rotation of the texture.

Cmn
BrushPaint.TextureLayer.SizeUnit

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

Cmn
@FloatRange(from = 0.0, fromInclusive = false, toInclusive = false) Float

The width of the texture, specified in sizeUnits.

Cmn
@FloatRange(from = 0.0, fromInclusive = false, toInclusive = false) Float

The height of the texture, specified in sizeUnits.

Cmn
BrushPaint.TextureLayer.Wrap

The horizontal wrapping mode for this texture layer.

Cmn
BrushPaint.TextureLayer.Wrap

The vertical wrapping mode for this texture layer.

Cmn

Inherited properties

From androidx.ink.brush.BrushPaint.TextureLayer
BrushPaint.TextureLayer.BlendMode

The rule by which the texture layers up to and including this one are combined with the subsequent layer.

Cmn

Public companion functions

builder

fun builder(): BrushPaint.TilingTexture.Builder

Returns a new TilingTexture.Builder.

Public constructors

TilingTexture

TilingTexture(
    clientTextureId: String,
    sizeX: @FloatRange(from = 0.0, fromInclusive = false, toInclusive = false) Float,
    sizeY: @FloatRange(from = 0.0, fromInclusive = false, toInclusive = false) Float,
    offsetX: Float = 0.0f,
    offsetY: Float = 0.0f,
    rotationDegrees: @AngleDegreesFloat Float = 0.0f,
    sizeUnit: BrushPaint.TextureLayer.SizeUnit = SizeUnit.STROKE_COORDINATES,
    origin: BrushPaint.TilingTexture.Origin = Origin.STROKE_SPACE_ORIGIN,
    wrapX: BrushPaint.TextureLayer.Wrap = Wrap.REPEAT,
    wrapY: BrushPaint.TextureLayer.Wrap = Wrap.REPEAT,
    blendMode: BrushPaint.TextureLayer.BlendMode = BlendMode.MODULATE
)

Creates a new TilingTexture with the specified parameters.

Java callers should use the Builder class instead.

Parameters
clientTextureId: String

A string identifier of an image that provides the color for a particular pixel for this layer. The coordinates within this image that will be used are determined by the other parameters.

sizeX: @FloatRange(from = 0.0, fromInclusive = false, toInclusive = false) Float

The X size in TextureLayer.SizeUnit of the image specified by clientTextureId.

sizeY: @FloatRange(from = 0.0, fromInclusive = false, toInclusive = false) Float

The Y size in TextureLayer.SizeUnit of the image specified by clientTextureId.

offsetX: Float = 0.0f

An offset into the texture, specified as fractions of the texture sizeX.

offsetY: Float = 0.0f

An offset into the texture, specified as fractions of the texture sizeY.

rotationDegrees: @AngleDegreesFloat Float = 0.0f

Angle in degrees specifying the rotation of the texture. The rotation is carried out about the center of the texture's first repetition along both axes.

sizeUnit: BrushPaint.TextureLayer.SizeUnit = SizeUnit.STROKE_COORDINATES

The units used to specify sizeX and sizeY.

origin: BrushPaint.TilingTexture.Origin = Origin.STROKE_SPACE_ORIGIN

The origin point to be used for texture space.

wrapX: BrushPaint.TextureLayer.Wrap = Wrap.REPEAT

The wrap mode along the horizontal texture axis.

wrapY: BrushPaint.TextureLayer.Wrap = Wrap.REPEAT

The wrap mode along the vertical texture axis.

blendMode: BrushPaint.TextureLayer.BlendMode = BlendMode.MODULATE

The method by which the texture layers up to this one (index <= i) are combined with the subsequent texture layer (index == i+1). For the last texture layer, this defines the method by which the texture layer is combined with the brush color (possibly after that color gets per-vertex adjustments).

Public functions

copy

fun copy(
    clientTextureId: String = this.clientTextureId,
    sizeX: @FloatRange(from = 0.0, fromInclusive = false, toInclusive = false) Float = this.sizeX,
    sizeY: @FloatRange(from = 0.0, fromInclusive = false, toInclusive = false) Float = this.sizeY,
    offsetX: Float = this.offsetX,
    offsetY: Float = this.offsetY,
    rotationDegrees: @AngleDegreesFloat Float = this.rotationDegrees,
    sizeUnit: BrushPaint.TextureLayer.SizeUnit = this.sizeUnit,
    origin: BrushPaint.TilingTexture.Origin = this.origin,
    wrapX: BrushPaint.TextureLayer.Wrap = this.wrapX,
    wrapY: BrushPaint.TextureLayer.Wrap = this.wrapY,
    blendMode: BrushPaint.TextureLayer.BlendMode = this.blendMode
): BrushPaint.TilingTexture

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(): BrushPaint.TilingTexture.Builder

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

toString

open fun toString(): String

Public properties

clientTextureId

val clientTextureIdString

offsetX

val offsetXFloat

The horizontal offset for the texture, specified as a fraction of the texture width.

offsetY

val offsetYFloat

The vertical offset for the texture, specified as a fraction of the texture height.

origin

val originBrushPaint.TilingTexture.Origin

The origin that will be used for positioning this texture layer.

rotationDegrees

val rotationDegrees: @AngleDegreesFloat Float

Angle specifying the rotation of the texture. The rotation is carried out about the center of the texture's first repetition along both axes.

sizeUnit

val sizeUnitBrushPaint.TextureLayer.SizeUnit

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

sizeX

val sizeX: @FloatRange(from = 0.0, fromInclusive = false, toInclusive = false) Float

The width of the texture, specified in sizeUnits.

sizeY

val sizeY: @FloatRange(from = 0.0, fromInclusive = false, toInclusive = false) Float

The height of the texture, specified in sizeUnits.

wrapX

val wrapXBrushPaint.TextureLayer.Wrap

The horizontal wrapping mode for this texture layer.

wrapY

val wrapYBrushPaint.TextureLayer.Wrap

The vertical wrapping mode for this texture layer.