KNode

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

Extends Tree API with type-safe widget builders.

Constructors

Link copied to clipboard
constructor(actor: T)

Properties

Link copied to clipboard
var actor: T
Link copied to clipboard
val children: Array<KNode<*>>
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
@get:Null
var icon: Drawable
Link copied to clipboard
open val <T : Actor> T.inNode: KNode<T>

Allows to access Node in this actor is stored in the Tree. Relies on the Actor.userObject mechanism.

Link copied to clipboard
@get:Null
val parent: KNode<*>
Link copied to clipboard
Link copied to clipboard
@get:Null
var value: Any?

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
open fun add(p0: KNode<*>)
open override fun <T : Actor> add(actor: T): KNode<T>
Link copied to clipboard
open fun addAll(p0: Array<KNode<*>>)
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
open fun clearChildren()
Link copied to clipboard
open fun collapseAll()
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
open fun expandAll()
Link copied to clipboard
open fun expandTo()
Link copied to clipboard
open fun findExpandedValues(p0: Array<Any?>)
Link copied to clipboard
@Null
open fun findNode(p0: Any?): KNode<*>
Link copied to clipboard
open fun getLevel(): Int
Link copied to clipboard
@Null
open fun getTree(): Tree<KNode<*>, Any?>
Link copied to clipboard
open fun hasChildren(): Boolean
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
open fun insert(p0: Int, p1: KNode<*>)
Link copied to clipboard
inline operator fun invoke(init: KNode<T>.() -> Unit): KNode<T>

Allows to inline a function block on a KNode. Syntax sugar for nested Tree nodes creation.

Link copied to clipboard
open fun isAscendantOf(p0: KNode<*>): Boolean
Link copied to clipboard
open fun isDescendantOf(p0: KNode<*>): Boolean
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
open fun <T : Actor> T.node(icon: Drawable? = null, expanded: Boolean? = null, selectable: Boolean? = null, userObject: Any? = null): T

Allows to customize properties of the Node storing this actor .

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
open fun remove()
open fun remove(p0: KNode<*>)
Link copied to clipboard
open fun restoreExpandedValues(p0: Array<Any?>)
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
open override fun <T : Actor> storeActor(actor: T): KNode<T>

Internal utility method for adding actors to the group. Assumes the actor might be stored in a container.

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 <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
open fun updateChildren()
Link copied to clipboard
inline fun <S> KWidget<S>.verticalGroup(init: KVerticalGroup.(S) -> Unit = {}): KVerticalGroup