Skip to content

Texture

@Composable



fun Texture(
    loc: ResourceLocation, 
    uOffset: Float, 
    vOffset: Float, 
    u: Int, 
    v: Int, 
    textureWidth: Int, 
    textureHeight: Int, 
    modifier: Modifier = Modifier
)

Renders a sprite or texture region using UV coordinates.

The composable sizes itself to the minimum constraints provided by its parent and blits the specified source region from loc into the node's bounds.

Parameters

  • loc: Resource location of the texture or atlas sprite.

  • uOffset: Horizontal UV start offset within the source image (in texture pixels).

  • vOffset: Vertical UV start offset within the source image (in texture pixels).

  • u: Width of the source region in texture pixels.

  • v: Height of the source region in texture pixels.

  • textureWidth: Total width of the source image in pixels.

  • textureHeight: Total height of the source image in pixels.

  • modifier: Additional modifiers applied to the layout node.