All Downloads are FREE. Search and download functionalities are using the official Maven repository.

net.peanuuutz.fork.ui.scene.screen.ComposeScreens.kt Maven / Gradle / Ivy

The newest version!
package net.peanuuutz.fork.ui.scene.screen

import androidx.compose.runtime.Composable
import net.minecraft.text.Text
import net.peanuuutz.fork.ui.ui.draw.canvas.Canvas
import net.peanuuutz.fork.util.minecraft.client

inline fun openScreen(
    title: Text = Text.empty(),
    canvas: Canvas = ScreenCanvas(),
    crossinline content: @Composable () -> Unit
) {
    val screen = object : ComposeScreen(
        parent = client.currentScreen,
        title = title,
        canvas = canvas
    ) {
        @Composable
        override fun Content() {
            content()
        }
    }
    client.setScreen(screen)
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy