Skip to content

K.UI ​

Functions ​

K.UI.New ​

lua
K.UI.New(className: string, props: { [any]: any }?): any

Creates any GUI object: K.UI.New("Frame", { ... }) or K.UI.New "Frame" { ... }.

K.UI.Screen ​

lua
K.UI.Screen(name: string, props: { [any]: any }?): ScreenGui

A ScreenGui in the player's screen. Building it again with the same name replaces the old one.

K.UI.Panel ​

lua
K.UI.Panel(props: { [any]: any }?): Frame

A rounded box with padding that grows to fit what's inside.

K.UI.Label ​

lua
K.UI.Label(props: { [any]: any }?): TextLabel

K.UI.Button ​

lua
K.UI.Button(props: { [any]: any }?): TextButton

A button that reacts to hover and presses. OnClick works for mouse, touch and gamepad.

K.UI.Image ​

lua
K.UI.Image(props: { [any]: any }?): ImageLabel

K.UI.Bar ​

lua
K.UI.Bar(props: { [any]: any }?): Frame

A progress bar. Value goes from 0 (empty) to 1 (full) and can be a State.

K.UI.ForEach ​

lua
K.UI.ForEach(list: any, render: (any, any) -> Instance?)

One child per item of a list State, rebuilt when the list changes: K.UI.ForEach(stacks, function(stack, index) return K.UI.Label({ Text = stack.Id }) end)

K.UI.FromCurrency ​

lua
K.UI.FromCurrency(name: string)

A State that always holds your amount of a currency.

K.UI.FromInventory ​

lua
K.UI.FromInventory(name: string)

A State that always holds the stacks in one of your inventories.

K.UI.FromValue ​

lua
K.UI.FromValue(value: any, default: any?)

A State that always holds one of your K.Value values (a name or the value itself). default is used until the server's value arrives: K.UI.FromValue("Ore", 0).

K.UI.FromShared ​

lua
K.UI.FromShared(name: string)

A State that always holds a K.Shared value.

K.UI.FromTimer ​

lua
K.UI.FromTimer(name: string)

A State holding the whole seconds left on a K.Timer (yours, or a shared one). 0 when it isn't running.

K.UI.FromMachine ​

lua
K.UI.FromMachine(name: string)

A State holding a named K.Machine: { State, TimeLeft (whole seconds) }.

K.UI.FromStat ​

lua
K.UI.FromStat(name: string)

A State that always holds one of your stats.

K.UI.FromQuests ​

lua
K.UI.FromQuests(): Reactive.State

A State holding your active quests: { { Id, Name, Objectives = { { Text, Progress, Amount } }, Ready } }.

K.UI.FromLeaderboard ​

lua
K.UI.FromLeaderboard(name: string)

A State holding a global leaderboard's top entries: { { Rank, UserId, Name, Value } }.

K.UI.FromRound ​

lua
K.UI.FromRound()

A State holding the round: { State, TimeLeft (whole seconds), Map, Alive, Score }. It updates every second while there's a countdown.

K.UI.FromHealth ​

lua
K.UI.FromHealth()

A State holding your character's health from 0 to 1 (handy for K.UI.Bar), following respawns.

Generated from src/Corode/UI.luau.

Corode 0.13.0 · MIT License