Skip to content

net.kernelpanicsoft.archie.gui.composables.basic

Types

ProgressDirection

Functions

Divider

@Composable



fun Divider(
    modifier: Modifier = Modifier, 
    color: Int = KColor.GRAY.argb, 
    thickness: Int = 1, 
    vertical: Boolean = false
)

Draws a thin horizontal or vertical separator line.

EnergyBar

@Composable



fun EnergyBar(
    storage: ArchieEnergyStorage, 
    modifier: Modifier = Modifier, 
    direction: ProgressDirection = ProgressDirection.BOTTOM_TO_TOP, 
    fillColor: Int = 0xFFFF5C33.toInt(), 
    variant: String = ThemeVariants.DEFAULT
)

Convenience overload reading directly from an ArchieEnergyStorage.

@Composable



fun EnergyBar(
    energy: Long, 
    capacity: Long, 
    modifier: Modifier = Modifier, 
    direction: ProgressDirection = ProgressDirection.BOTTOM_TO_TOP, 
    fillColor: Int = 0xFFFF5C33.toInt(), 
    variant: String = ThemeVariants.DEFAULT
)

A themed energy-level indicator (looked up in the current theme as "energy_bar"), filled with a solid color up to energy / capacity.

FluidTank

@Composable



fun FluidTank(
    fluid: FluidStack, 
    capacity: Long, 
    modifier: Modifier = Modifier, 
    variant: String = ThemeVariants.DEFAULT
)

A themed fluid-level indicator (looked up in the current theme as "fluid_tank"): a tank frame sprite with the real fluid texture and tint (via FluidStackHooks) filling it bottom-up to fluid.amount / capacity.

getTextSize

fun getTextSize(
    text: Component, 
    scale: Float = 1.0f, 
    font: Font = requireMinecraftClient.font
): Size

Returns the rendered pixel size (width × height) of text at the given scale.

HorizontalDivider

@Stable



@Composable



fun HorizontalDivider(
    modifier: Modifier = Modifier, 
    color: Int = KColor.GRAY.argb, 
    thickness: Int = 1
)

Convenience horizontal divider.

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.

Label

@Composable



fun Label(
    text: Component, 
    fontScale: Float = 1.0f, 
    font: Font = requireMinecraftClient.font, 
    color: KColor = LocalTheme.current.darkTextColor, 
    dropShadow: Boolean = false, 
    modifier: Modifier = Modifier
)

ProgressBar

@Composable



fun ProgressBar(
    progress: Float, 
    modifier: Modifier = Modifier, 
    direction: ProgressDirection = ProgressDirection.LEFT_TO_RIGHT, 
    fillColor: Int = 0xFF6BA8FF.toInt(), 
    variant: String = ThemeVariants.DEFAULT
)

A themed linear progress indicator: an empty-track sprite from the current theme (looked up as "progress_bar"), filled with a solid color up to progress.

Spacer

@Composable



fun Spacer(modifier: Modifier = Modifier)

An invisible layout composable that expands to fill available space.

Text

@Composable



fun Text(
    text: Component, 
    fontScale: Float = 1.0f, 
    font: Font = requireMinecraftClient.font, 
    color: KColor = LocalTheme.current.lightTextColor, 
    dropShadow: Boolean = true, 
    modifier: Modifier = Modifier
)

Renders a Component using Minecraft's font renderer.

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.

VerticalDivider

@Stable



@Composable



fun VerticalDivider(
    modifier: Modifier = Modifier, 
    color: Int = KColor.GRAY.argb, 
    thickness: Int = 1
)

Convenience vertical divider.