Package-level declarations

Types

Link copied to clipboard
class KButton(skin: Skin, style: String) : Button, KTable

Extends Button API with type-safe widget builders.

Link copied to clipboard
class KButtonTable(minCheckCount: Int, maxCheckCount: Int, skin: Skin) : Table, KTable

Extends Table API with type-safe widget builders. All Button instances added to this table will be automatically included in an internal ButtonGroup.

Link copied to clipboard
class KCheckBox(text: String, skin: Skin, style: String) : CheckBox, KTable

Extends CheckBox API with type-safe widget builders.

Link copied to clipboard
class KContainer<T : Actor>(actor: T? = null) : Container<T> , KGroup

Extends Container API with type-safe widget builders. Note that this widget may store only a single child.

Link copied to clipboard
class KDialog(title: String, skin: Skin, style: String) : Dialog, KTable

Extends Dialog API with type-safe widget builders.

Link copied to clipboard
interface KGroup : KWidget<Actor>

Common interface applied to widgets that extend WidgetGroup or Group and keep their children in an internal collection with no specialized containers such as Cell or Node.

Link copied to clipboard
class KHorizontalGroup : HorizontalGroup, KGroup

Extends HorizontalGroup API with type-safe widget builders.

Link copied to clipboard
class KImageButton(skin: Skin, style: String) : ImageButton, KTable

Extends ImageButton API with type-safe widget builders.

Link copied to clipboard
class KImageTextButton(text: String, skin: Skin, style: String) : ImageTextButton, KTable

Extends ImageTextButton API with type-safe widget builders.

Link copied to clipboard
class KListWidget<T>(skin: Skin, style: String) : List<T>

Extends libGDX List widget with items building method.

Link copied to clipboard
class KNode<T : Actor>(actor: T) : Tree.Node<KNode<*>, Any?, T> , KTree

Extends Tree API with type-safe widget builders.

Link copied to clipboard
class KScrollPane(skin: Skin, style: String) : ScrollPane, KGroup

Extends ScrollPane API with type-safe widget builders. Note that this widget may store only a single child.

Link copied to clipboard
class KSelectBox<T>(skin: Skin, style: String) : SelectBox<T>

Extends SelectBox with items building method.

Link copied to clipboard
class KSplitPane(vertical: Boolean, skin: Skin, style: String) : SplitPane, KGroup

Extends SplitPane API with type-safe widget builders. Note that this widget may store only two children. It is advised to use the inlined extension factory methods added by KGroup rather than set its widgets directly with setFirstWidget or setSecondWidget.

Link copied to clipboard
class KStack : Stack, KGroup

Extends Stack API with type-safe widget builders.

Link copied to clipboard
interface KTable : KWidget<Cell<*>>

Common interface applied to widgets that extend the original Table and keep their children in Cell instances.

Link copied to clipboard
class KTableWidget(skin: Skin) : Table, KTable

Extends Table API with type-safe widget builders.

Link copied to clipboard
class KTextButton(text: String, skin: Skin, style: String) : TextButton, KTable

Extends TextButton API with type-safe widget builders.

Link copied to clipboard
interface KTree : KWidget<KNode<*>>

Common interface applied to widgets that keep their children in Tree instances.

Link copied to clipboard
class KTreeWidget(skin: Skin, style: String) : Tree<KNode<*>, Any?> , KTree

Extends Tree API with type-safe widget builders.

Link copied to clipboard
class KVerticalGroup : VerticalGroup, KGroup

Extends VerticalGroup API with type-safe widget builders.

Link copied to clipboard
interface KWidget<out Storage>

Common interface applied to so-called "parental" widgets.

Link copied to clipboard
class KWindow(title: String, skin: Skin, style: String) : Window, KTable

Extends Window API with type-safe widget builders.

Link copied to clipboard
interface RootWidget : KWidget<Actor>

A specialized interface for widgets that can create top-level root actors.

Link copied to clipboard

Root of the Scene2D DSL. Use this object to create new Scene2D actors and widgets without parents.

Link copied to clipboard
Link copied to clipboard

Utility storage for global Skin object. The skin will be used by the widget factory methods by default if no custom alternative skin instance is passed as an alternative.

Link copied to clipboard
class StageWidget(val stage: Stage) : RootWidget

A dummy widget that allows to add actors directly to the stage with Scene2D DSL.

Properties

Link copied to clipboard

Style used by default by constructors of some aligned widgets like SplitPane.

Link copied to clipboard
const val defaultStyle: String

Style used by default by most widget constructors. Most factory methods default to this style if a custom one is not chosen.

Link copied to clipboard

Style used by default by constructors of some aligned widgets like SplitPane.

Functions

Link copied to clipboard
inline fun <S, A : Actor> KWidget<S>.actor(actor: A, init: A.(S) -> Unit = {}): A

Utility function for adding existing actors to the group with a type-safe builder init block. Mostly for internal use.

Link copied to clipboard
inline fun Stage.actors(init: StageWidget.() -> Unit)

Allows to create and add actors directly to this Stage.

Link copied to clipboard
inline fun <S> KWidget<S>.button(style: String = defaultStyle, skin: Skin = Scene2DSkin.defaultSkin, init: KButton.(S) -> Unit = {}): KButton
Link copied to clipboard
inline fun <S> KWidget<S>.buttonGroup(minCheckedCount: Int, maxCheckedCount: Int, skin: Skin = Scene2DSkin.defaultSkin, init: KButtonTable.(S) -> Unit = {}): KButtonTable
Link copied to clipboard
inline fun <S> KWidget<S>.checkBox(text: String, style: String = defaultStyle, skin: Skin = Scene2DSkin.defaultSkin, init: KCheckBox.(S) -> Unit = {}): KCheckBox
Link copied to clipboard
inline fun <S> KWidget<S>.container(init: KContainer<Actor>.(S) -> Unit = {}): KContainer<Actor>

inline fun <S, A : Actor> KWidget<S>.container(actor: A, init: KContainer<A>.(S) -> Unit = {}): KContainer<A>

Use this container method variant for customly built actors that you want to keep in a Container.

Link copied to clipboard
inline fun RootWidget.dialog(title: String, style: String = defaultStyle, skin: Skin = Scene2DSkin.defaultSkin, init: KDialog.() -> Unit = {}): KDialog

Constructs a top-level Dialog widget.

Link copied to clipboard
Link copied to clipboard
inline fun <S> KWidget<S>.image(texture: Texture, init: Image.(S) -> Unit = {}): Image
inline fun <S> KWidget<S>.image(ninePatch: NinePatch, init: Image.(S) -> Unit = {}): Image
inline fun <S> KWidget<S>.image(textureRegion: TextureRegion, init: Image.(S) -> Unit = {}): Image
inline fun <S> KWidget<S>.image(drawable: Drawable? = null, init: Image.(S) -> Unit = {}): Image
inline fun <S> KWidget<S>.image(drawableName: String, skin: Skin = Scene2DSkin.defaultSkin, init: Image.(S) -> Unit = {}): Image
Link copied to clipboard
inline fun <S> KWidget<S>.imageButton(style: String = defaultStyle, skin: Skin = Scene2DSkin.defaultSkin, init: KImageButton.(S) -> Unit = {}): KImageButton
Link copied to clipboard
inline fun <S> KWidget<S>.imageTextButton(text: String, style: String = defaultStyle, skin: Skin = Scene2DSkin.defaultSkin, init: KImageTextButton.(S) -> Unit = {}): KImageTextButton
Link copied to clipboard
inline fun <S> KWidget<S>.label(text: CharSequence, style: String = defaultStyle, skin: Skin = Scene2DSkin.defaultSkin, init: Label.(S) -> Unit = {}): Label
Link copied to clipboard
inline fun <I> KWidget<*>.listWidget(style: String = defaultStyle, skin: Skin = Scene2DSkin.defaultSkin, init: KListWidget<I>.() -> Unit = {}): KListWidget<I>
Link copied to clipboard
fun <I> KWidget<*>.listWidgetOf(items: Array<I>? = null, style: String = defaultStyle, skin: Skin = Scene2DSkin.defaultSkin): KListWidget<I>
Link copied to clipboard
inline fun <S> KWidget<S>.particleEffect(particleEffect: ParticleEffect, resetOnStart: Boolean = true, init: ParticleEffectActor.(S) -> Unit = {}): ParticleEffectActor
Link copied to clipboard
inline fun <S> KWidget<S>.progressBar(min: Float = 0.0f, max: Float = 1.0f, step: Float = 0.01f, vertical: Boolean = false, style: String = if (vertical) defaultVerticalStyle else defaultHorizontalStyle, skin: Skin = Scene2DSkin.defaultSkin, init: ProgressBar.(S) -> Unit = {}): ProgressBar
Link copied to clipboard
inline fun <T : Actor> scene2d(dsl: RootWidget.() -> T): T

Allows to define an actor within a DSL lambda block.

Link copied to clipboard
inline fun <S> KWidget<S>.scrollPane(style: String = defaultStyle, skin: Skin = Scene2DSkin.defaultSkin, init: KScrollPane.(S) -> Unit = {}): KScrollPane
Link copied to clipboard
inline fun <I> KWidget<*>.selectBox(style: String = defaultStyle, skin: Skin = Scene2DSkin.defaultSkin, init: KSelectBox<I>.() -> Unit = {}): KSelectBox<I>
Link copied to clipboard
fun <I> KWidget<*>.selectBoxOf(items: Array<I>? = null, style: String = defaultStyle, skin: Skin = Scene2DSkin.defaultSkin): KSelectBox<I>
Link copied to clipboard
inline fun <S> KWidget<S>.slider(min: Float = 0.0f, max: Float = 1.0f, step: Float = 0.01f, vertical: Boolean = false, style: String = if (vertical) defaultVerticalStyle else defaultHorizontalStyle, skin: Skin = Scene2DSkin.defaultSkin, init: Slider.(S) -> Unit = {}): Slider
Link copied to clipboard
inline fun <S> KWidget<S>.splitPane(vertical: Boolean = false, style: String = if (vertical) defaultVerticalStyle else defaultHorizontalStyle, skin: Skin = Scene2DSkin.defaultSkin, init: KSplitPane.(S) -> Unit = {}): KSplitPane
Link copied to clipboard
inline fun <S> KWidget<S>.stack(init: KStack.(S) -> Unit = {}): KStack
Link copied to clipboard
inline fun <S> KWidget<S>.table(skin: Skin = Scene2DSkin.defaultSkin, init: KTableWidget.(S) -> Unit = {}): KTableWidget
Link copied to clipboard
inline fun <S> KWidget<S>.textArea(text: String = "", style: String = defaultStyle, skin: Skin = Scene2DSkin.defaultSkin, init: TextArea.(S) -> Unit = {}): TextArea
Link copied to clipboard
inline fun <S> KWidget<S>.textButton(text: String, style: String = defaultStyle, skin: Skin = Scene2DSkin.defaultSkin, init: KTextButton.(S) -> Unit = {}): KTextButton
Link copied to clipboard
inline fun <S> KWidget<S>.textField(text: String = "", style: String = defaultStyle, skin: Skin = Scene2DSkin.defaultSkin, init: TextField.(S) -> Unit = {}): TextField
Link copied to clipboard
inline fun Actor.textTooltip(text: String, style: String = defaultStyle, skin: Skin = Scene2DSkin.defaultSkin, tooltipManager: TooltipManager = TooltipManager.getInstance(), init: Label.(TextTooltip) -> Unit = {}): TextTooltip

Adds a new TextTooltip to this actor.

Link copied to clipboard
inline fun Actor.tooltip(background: String? = null, skin: Skin = Scene2DSkin.defaultSkin, tooltipManager: TooltipManager = TooltipManager.getInstance(), init: KTableWidget.(Tooltip<KTableWidget>) -> Unit = {}): Tooltip<KTableWidget>

Adds a new Tooltip to this actor, storing a flexible Table widget.

Link copied to clipboard
inline fun <S> KWidget<S>.touchpad(deadzone: Float, style: String = defaultStyle, skin: Skin = Scene2DSkin.defaultSkin, init: Touchpad.(S) -> Unit = {}): Touchpad
Link copied to clipboard
inline fun <S> KWidget<S>.tree(style: String = defaultStyle, skin: Skin = Scene2DSkin.defaultSkin, init: KTreeWidget.(S) -> Unit = {}): KTreeWidget
Link copied to clipboard
inline fun <S> KWidget<S>.verticalGroup(init: KVerticalGroup.(S) -> Unit = {}): KVerticalGroup
Link copied to clipboard
inline fun RootWidget.window(title: String, style: String = defaultStyle, skin: Skin = Scene2DSkin.defaultSkin, init: KWindow.() -> Unit = {}): KWindow

Constructs a top-level Window widget.