public open class RemoteDrawScope internal constructor(
@get:RestrictTo(RestrictTo.Scope.LIBRARY_GROUP) public val remoteCanvas: RemoteCanvas
) : RemoteStateScope
A remote-compatible drawing scope for RemoteCompose. Unlike DrawScope, this class uses remote types consistently and does not attempt to implement the standard DrawScope interface to avoid API incompatibilities.
Properties
remoteComposeCreationState
public val remoteComposeCreationState: RemoteComposeCreationState
width
public open val width: RemoteFloat
The width of the drawing area as a RemoteFloat.
height
public open val height: RemoteFloat
The height of the drawing area as a RemoteFloat.
center
public val center: RemoteOffset
The center of the drawing area as a RemoteOffset.
size
public val size: RemoteSize
The size of the drawing area as a RemoteSize.
remote
public val remote: RemoteAccess = RemoteAccess(this)
Access to remote-specific utilities like time and animations.
Functions
usePaint
public fun usePaint(paint: RemotePaint, block: () -> Unit)
drawRect
public fun drawRect(
paint: RemotePaint?,
topLeft: RemoteOffset = RemoteOffset.Zero,
size: RemoteSize = [email protected],
)
Draws a rectangle with the given paint, topLeft offset, and size.
Parameters
| paint | The RemotePaint to use for drawing the rectangle. |
| topLeft | The top left offset of the rectangle. |
| size | The size of the rectangle. |
drawRoundRect
public fun drawRoundRect(
paint: RemotePaint?,
topLeft: RemoteOffset = RemoteOffset.Zero,
size: RemoteSize = [email protected],
cornerRadius: RemoteOffset = RemoteOffset.Zero,
)
drawCircle
public fun drawCircle(
paint: RemotePaint?,
radius: RemoteFloat,
center: RemoteOffset = [email protected],
)
Draws a circle.
drawOval
public fun drawOval(
paint: RemotePaint?,
topLeft: RemoteOffset = RemoteOffset.Zero,
size: RemoteSize = [email protected],
)
drawArc
public fun drawArc(
paint: RemotePaint?,
startAngle: RemoteFloat,
sweepAngle: RemoteFloat,
useCenter: Boolean,
topLeft: RemoteOffset = RemoteOffset.Zero,
size: RemoteSize = [email protected],
)
drawLine
public fun drawLine(paint: RemotePaint?, start: RemoteOffset, end: RemoteOffset)
Draws a line.
drawTextOnCircle
public fun drawTextOnCircle(
text: RemoteString,
centerX: RemoteFloat,
centerY: RemoteFloat,
radius: RemoteFloat,
startAngle: RemoteFloat,
warpRadiusOffset: RemoteFloat,
paint: RemotePaint? = null,
alignment: CircularAlignment = CircularAlignment.Center,
placement: CircularPlacement = CircularPlacement.Outside,
)
Draws text along a circle.
Parameters
| text | The text to draw. |
| centerX | The x-coordinate of the circle's center. |
| centerY | The y-coordinate of the circle's center. |
| radius | The radius of the circle. |
| startAngle | The starting angle for the text. |
| warpRadiusOffset | The offset of the text from the circle. |
| paint | Paint of the text. |
| alignment | The alignment of the text relative to start. |
| placement | The placement inside or outside the circle. |
Members
CircularAlignment
public enum class CircularAlignment {
Start,
Center,
End;
internal fun toCore(): DrawTextOnCircle.Alignment =
when (this) {
Start -> DrawTextOnCircle.Alignment.START
Center -> DrawTextOnCircle.Alignment.CENTER
End -> DrawTextOnCircle.Alignment.END
}
}
Alignment of text along a circular path.
Members
Start
Start
Center
Center
End
End
CircularPlacement
public enum class CircularPlacement {
Outside,
Inside;
internal fun toCore(): DrawTextOnCircle.Placement =
when (this) {
Outside -> DrawTextOnCircle.Placement.OUTSIDE
Inside -> DrawTextOnCircle.Placement.INSIDE
}
}
Placement of text relative to the circular path.
Members
Outside
Outside
Inside
Inside