🌈 Create new beautiful Compose Gradients with our new wesite ->
Function

graphicsLayer

Applies a graphics layer modifier to the RemoteModifier.

graphicsLayer

Source set: Android
public fun RemoteModifier.graphicsLayer(
    scaleX: RemoteFloat = 1f.rf,
    scaleY: RemoteFloat = 1f.rf,
    rotationX: RemoteFloat = 0f.rf,
    rotationY: RemoteFloat = 0f.rf,
    rotationZ: RemoteFloat = 0f.rf,
    shadowElevation: RemoteFloat = 0f.rf,
    transformOriginX: RemoteFloat = 0.5f.rf,
    transformOriginY: RemoteFloat = 0.5f.rf,
    translationX: RemoteFloat = 0f.rf,
    translationY: RemoteFloat = 0f.rf,
    alpha: RemoteFloat = 1f.rf,
    shape: Shape = RectangleShape,
    compositingStrategy: CompositingStrategy = Auto,
    cameraDistance: RemoteFloat = 8f.rf, // Default Value for Camera Distance
    renderEffect: RenderEffect? = null,
): RemoteModifier

Applies a graphics layer modifier to the RemoteModifier.

A graphics layer modifier can be used to apply effects such as scaling, rotation, translation, shadow, clipping, alpha, and render effects (like blur) to the drawing content.

This overload accepts RemoteFloat values, which allow binding properties to dynamic expressions or state.

Parameters

scaleX The horizontal scale factor.
scaleY The vertical scale factor.
rotationX The rotation of the layer around the X axis, in degrees.
rotationY The rotation of the layer around the Y axis, in degrees.
rotationZ The rotation of the layer around the Z axis, in degrees.
shadowElevation The shadow elevation of the layer.
transformOriginX The horizontal center of the transform, as a fraction of the layer width.
transformOriginY The vertical center of the transform, as a fraction of the layer height.
translationX The horizontal translation of the layer.
translationY The vertical translation of the layer.
alpha The alpha (opacity) of the layer.
shape The shape of the layer.
compositingStrategy The compositing strategy to use for the layer.
cameraDistance The camera distance for 3D transforms.
renderEffect The RenderEffect to apply, or null.

graphicsLayer

Source set: Android
public fun RemoteModifier.graphicsLayer(block: GraphicsLayerScope.() -> Unit): RemoteModifier

Applies a graphics layer modifier to the RemoteModifier using a type-safe builder lambda.

This overload allows configuring layer properties within a GraphicsLayerScope block, which is similar to standard Compose's graphicsLayer { ... }.

Example usage:

modifier.graphicsLayer {
alpha = 0.5f.rf
rotationZ = 45f.rf
}

Parameters

block The lambda block to configure the GraphicsLayerScope.

Content updated: