Skip to content

Icon

@Composable



fun Icon(
    texture: ResourceLocation, 
    size: Int = 16, 
    uOffset: Float = 0.0f, 
    vOffset: Float = 0.0f, 
    u: Int = size, 
    v: Int = size, 
    textureWidth: Int = 256, 
    textureHeight: Int = 256, 
    modifier: Modifier = Modifier
)

Convenience wrapper around Texture for fixed-size icon sprites.

Parameters

  • texture: The sprite sheet/texture location.

  • size: The icon's rendered width and height, in pixels.

  • uOffset: The sprite's left edge within texture, in texture pixels.

  • vOffset: The sprite's top edge within texture, in texture pixels.

  • u: The sprite's source width within texture. Defaults to size.

  • v: The sprite's source height within texture. Defaults to size.

  • textureWidth: The full width of texture, in pixels.

  • textureHeight: The full height of texture, in pixels.