Text

open class Text(text: String, textSize: Double = DEFAULT_TEXT_SIZE, color: RGBA = Colors.WHITE, font: Resourceable<out Font> = DefaultTtfFontAsBitmap, alignment: TextAlignment = TextAlignment.TOP_LEFT, renderer: TextRenderer<String> = DefaultStringTextRenderer, autoScaling: Boolean = DEFAULT_AUTO_SCALING, fill: Paint? = null, stroke: Stroke? = null) : Container, IText, ViewLeaf

Constructors

Link copied to clipboard
constructor(text: String, textSize: Double = DEFAULT_TEXT_SIZE, color: RGBA = Colors.WHITE, font: Resourceable<out Font> = DefaultTtfFontAsBitmap, alignment: TextAlignment = TextAlignment.TOP_LEFT, renderer: TextRenderer<String> = DefaultStringTextRenderer, autoScaling: Boolean = DEFAULT_AUTO_SCALING, fill: Paint? = null, stroke: Stroke? = null)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
Link copied to clipboard

Returns a list of all the non-null View.name values of this and the descendants

Link copied to clipboard

Shortcut for adjusting the multiplicative alpha value manually. Equivalent to ColorTransform.mA + View.invalidate

Link copied to clipboard
Link copied to clipboard

Returns the number of ancestors of this view. Views without parents return 0.

Link copied to clipboard

Returns a list of all the ancestors (including this) to reach the root node (usually the stage).

Link copied to clipboard
open val anchorDispX: Float
Link copied to clipboard
open val anchorDispY: Float
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

The BlendMode used for this view BlendMode.INHERIT will use the ancestors blendModes

Link copied to clipboard
open override val bview: View
Link copied to clipboard
open override val bviewAll: List<View>
Link copied to clipboard

A collection with all the children Views.

Link copied to clipboard
var color: RGBA
Link copied to clipboard

The multiplicative RGBA color.

Link copied to clipboard

Recursively retrieves the top ancestor in the container hierarchy.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open override var extra: ExtraType
Link copied to clipboard
Link copied to clipboard

An optional Filter attached to this view. Filters allow to render this view to a texture, and to control how to render that texture (using shaders, repeating the texture, etc.). You add multiple filters by creating a composite filter ComposedFilter.

Link copied to clipboard

Usually a value between 0.0, 1.0

Link copied to clipboard

Returns the first child of this container or null when the container doesn't have children

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Returns the global bounds of this object. Note this incurs in allocations. Use getGlobalBounds (out) to avoid it

Link copied to clipboard

Global transform Matrix. Matrix that concatenates all the affine transforms of this view and its ancestors.

Link copied to clipboard

The inverted version of the globalMatrix

Link copied to clipboard
Link copied to clipboard

Computed speed combining all the speeds from ancestors

Link copied to clipboard
Link copied to clipboard

Changes the height of this view. Generically, this means adjusting the scaleY of the view to match that size using the current bounds, but some views might override this to adjust its internal width or height (like SolidRect or UIView for example).

Link copied to clipboard
open var hitShape: VectorPath?
Link copied to clipboard
open override var hitShape2d: Shape2D
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
var index: Int

The index the child has in its parent

Link copied to clipboard

Indicates if this class is a container or not. This is only overridden by Container. This check is performed like this, to avoid type checks. That might be an expensive operation in some targets.

Link copied to clipboard
Link copied to clipboard

Returns the last child of this container or null when the container doesn't have children

Link copied to clipboard
Link copied to clipboard

Local transform MMatrix. If you plan to change its components manually instead of setting it directly, you should call the View.invalidate method.

Link copied to clipboard
var View.mask: View?
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Determines if mouse events will be handled for this view and its children

Link copied to clipboard
var name: String?

Optional name of this view

Link copied to clipboard
Link copied to clipboard

Returns the number of children this container has

Link copied to clipboard

Parent Container of this View if any, or null

Link copied to clipboard
var pos: Point
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Indicates if this view is going to propagate the events that reach this node to its children

Link copied to clipboard

Recursively retrieves the ancestor in the container hierarchy that is a View.Reference like the stage or null when can't be found.

Link copied to clipboard

The concatenated/global version of the local alpha

Link copied to clipboard

The concatenated/global version of the local alpha

Link copied to clipboard

The actual blendMode of the view after computing the ancestors and reaching a view with a non BlendMode.INHERIT.

Link copied to clipboard

The concatenated/global version of the local colorMul

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
val root: View

The ancestor view without parents. When attached (visible or invisible), this is the Stage. When no parents, it is this

Link copied to clipboard

Local rotation of this view

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Local scaling in the X axis of this view

Link copied to clipboard
Link copied to clipboard

Local scaling in the Y axis of this view

Link copied to clipboard
Link copied to clipboard
var size: Size
Link copied to clipboard

Local skewing in the X axis of this view

Link copied to clipboard

Local skewing in the Y axis of this view

Link copied to clipboard
Link copied to clipboard

Ratio speed of this node, affecting all the View.addUpdater

Link copied to clipboard
open val stage: Stage?

When included in the tree, this returns the stage. When not attached yet, this will return null.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open override var text: String
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
var tint: RGBA

Alias for colorMul to make this familiar to people coming from other engines.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open var unscaledSize: Size
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open var visible: Boolean

Determines if the view will be displayed or not. It is different to alpha=0, since the render method won't be executed. Usually giving better performance. But also not receiving events.

Link copied to clipboard

Changes the width of this view. Generically, this means adjusting the scaleX of the view to match that size using the current bounds, but some views might override this to adjust its internal width or height (like SolidRect or UIView for example).

Link copied to clipboard

Returns the global bounds of this object. Note this incurs in allocations. Use getGlobalBounds (out) to avoid it

Link copied to clipboard
var x: Double

Local X position of this view

Link copied to clipboard
var y: Double

Local Y position of this view

Link copied to clipboard

Functions

Link copied to clipboard
Link copied to clipboard

Like setTransform but without invalidation. If used at all, should be used with care and invalidate when required.

Link copied to clipboard
fun addChild(view: View)

Adds a child View to the container.

Link copied to clipboard
fun addChildAt(view: View, index: Int)

Adds the view as a child at a specific index.

Link copied to clipboard
fun addChildren(views: List<View?>?)
Link copied to clipboard
Link copied to clipboard
fun View?.allDescendants(out: ArrayList<View> = arrayListOf()): List<View>
Link copied to clipboard
fun View?.ancestorsUpTo(target: View?): List<View>

Returns a list of all the ancestors including this in order to reach from this view to the target view, or a list of all the ancestors in the case target is not an ancestor.

Link copied to clipboard
suspend fun View.animate(defaultTime: TimeSpan = Animator.DEFAULT_TIME, defaultSpeed: Double = Animator.DEFAULT_SPEED, defaultEasing: Easing = Animator.DEFAULT_EASING, parallel: Boolean = false, looped: Boolean = false, completeOnCancel: Boolean = false, startImmediately: Boolean = Animator.DEFAULT_START_IMMEDIATELY, block: Animator.() -> Unit = {}): Animator
Link copied to clipboard
fun View.animator(defaultTime: TimeSpan = Animator.DEFAULT_TIME, defaultSpeed: Double = Animator.DEFAULT_SPEED, defaultEasing: Easing = Animator.DEFAULT_EASING, parallel: Boolean = false, looped: Boolean = false, startImmediately: Boolean = Animator.DEFAULT_START_IMMEDIATELY, block: Animator.() -> Unit = {}): Animator
Link copied to clipboard
inline fun <T : View> Container.append(view: T): T
inline fun <T : View> Container.append(view: T, block: T.() -> Unit): T
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
inline fun BView.bviewFastForEach(block: (view: View) -> Unit)
Link copied to clipboard
inline fun Container.cachedContainer(cache: Boolean = true, callback: CachedContainer.() -> Unit = {}): CachedContainer
Link copied to clipboard
inline fun Container.camera(callback: Camera.() -> Unit = {}): Camera

Creates a new Camera and attaches to this. The callback argument is called with the Camera injected as this to be able to configure the camera.

Link copied to clipboard
inline fun Container.cameraContainer(size: Size, clip: Boolean = true, noinline contentBuilder: (camera: CameraContainer) -> Container = { FixedSizeContainer(it.size) }, noinline block: CameraContainer.() -> Unit = {}, content: Container.() -> Unit = {}): CameraContainer
Link copied to clipboard
inline fun Container.circle(radius: Number = 16.0, fill: Paint = Colors.WHITE, stroke: Paint = Colors.WHITE, strokeThickness: Number = 0.0, autoScaling: Boolean = true, renderer: GraphicsRenderer = GraphicsRenderer.GPU, callback: Circle.() -> Unit = {}): Circle

Creates a Circle of radius and fill. The autoScaling determines if the underlying texture will be updated when the hierarchy is scaled. The callback allows to configure the Circle instance.

Link copied to clipboard
fun <T : BEvent> clearEvents(type: EventType<T>)
Link copied to clipboard
inline fun Container.clipContainer(size: Size, callback: ClipContainer.() -> Unit = {}): ClipContainer
Link copied to clipboard
open override fun clone(): View

Performs a deep copy of the container, by copying all the child Views.

Link copied to clipboard
fun View?.commonAncestor(ancestor: View?): View?
Link copied to clipboard
inline fun Container.container(cull: Boolean = false, callback: Container.() -> Unit = {}): Container

Creates a new Container, allowing to configure with callback, and attaches the newly created container to the receiver this Container

Link copied to clipboard
fun View.convertToSpace(srcPoint: Point, dst: View): Point
Link copied to clipboard
open fun copyPropsFrom(source: View)

Allows to copy the basic properties (transform localMatrix, visible, colorMul, speed, name...) from source into this

Link copied to clipboard
inline fun Container.cpuGraphics(autoScaling: Boolean = false, callback: ShapeBuilder.(CpuGraphics) -> Unit = {}): CpuGraphics
inline fun Container.cpuGraphics(shape: Shape, antialiased: Boolean = true, callback: CpuGraphics.() -> Unit = {}): CpuGraphics
inline fun Container.cpuGraphics(build: ShapeBuilder.() -> Unit, antialiased: Boolean = true, callback: CpuGraphics.() -> Unit = {}): CpuGraphics
Link copied to clipboard
inline fun Container.debugVertexView(pointsList: List<DoubleVectorList> = listOf(), color: RGBA = Colors.WHITE, type: AGDrawType = AGDrawType.TRIANGLE_STRIP, callback: DebugVertexView.() -> Unit = {}): DebugVertexView
Link copied to clipboard
suspend fun View.delay(time: TimeSpan)
Link copied to clipboard
suspend fun View.delayFrame()
Link copied to clipboard
inline fun <T> View?.descendantsOfType(): List<T>
Link copied to clipboard
fun View?.descendantsWith(out: ArrayList<View> = arrayListOf(), check: (View) -> Boolean): List<View>

Returns a list of descendants including this that matches the check method. Allows to provide an out array to reduce allocations.

Link copied to clipboard
override fun <T : BEvent> dispatch(event: T): Boolean
override fun <T : BEvent> dispatch(type: EventType<T>, event: T, result: EventResult?): Boolean

open override fun <T : BEvent> dispatch(type: EventType<T>, event: T, result: EventResult?, up: Boolean, down: Boolean): Boolean

Dispatched a event of type that will execute all the handlers registered with onEvents in this object and its children.

Link copied to clipboard
open override fun <T : BEvent> dispatchChildren(type: EventType<T>, event: T, result: EventResult?)
Link copied to clipboard
open fun <T : BEvent> dispatchDown(type: EventType<T>, event: T, result: EventResult? = null): Boolean
Link copied to clipboard
Link copied to clipboard
open override fun <T : BEvent> dispatchParent(type: EventType<T>, event: T, result: EventResult?)
Link copied to clipboard
open fun <T : BEvent> dispatchUp(type: EventType<T>, event: T, result: EventResult? = null): Boolean
Link copied to clipboard
Link copied to clipboard
override fun <T : BEvent> dispatchWithResult(event: T, out: EventResult): EventResult
Link copied to clipboard
Link copied to clipboard
fun View?.dump(indent: String = "", emit: (String) -> Unit = ::println)

Dumps a view and its children for debugging purposes. The emit block parameter allows to define how to print those results.

Link copied to clipboard

Dumps a view and its children for debugging purposes into a String.

Link copied to clipboard
fun Text.editText(caretContainer: Container = this): TextEditController
Link copied to clipboard
inline fun Container.ellipse(radius: Size = Size(16, 16), fill: Paint = Colors.WHITE, stroke: Paint = Colors.WHITE, strokeThickness: Double = 0.0, autoScaling: Boolean = true, callback: Ellipse.() -> Unit = {}): Ellipse

Creates a Ellipse of radiusX, radiusY and fill. The autoScaling determines if the underlying texture will be updated when the hierarchy is scaled. The callback allows to configure the Circle instance.

Link copied to clipboard
inline fun Container.fastEllipse(size: Size, color: RGBA = Colors.WHITE, callback: FastEllipse.() -> Unit = {}): FastEllipse
Link copied to clipboard
inline fun fastForEachChild(block: (child: View) -> Unit)
Link copied to clipboard
inline fun fastForEachChildRender(block: (child: View) -> Unit)

Iterates children in render order

Link copied to clipboard
inline fun Container.fastRoundRect(size: Size, corners: RectCorners = RectCorners(.1f, .1f, 1f, 1f), color: RGBA = Colors.WHITE, callback: FastRoundRect.() -> Unit = {}): FastRoundRect
Link copied to clipboard
fun View?.findFirstAscendant(cond: (view: View) -> Boolean): View?
Link copied to clipboard
fun View?.findLastAscendant(cond: (view: View) -> Boolean): View?
Link copied to clipboard
open override fun findViewByName(name: String): View?

Allows to find a descendant view whose View.name property is name. Returns null if can't find any.

Link copied to clipboard
fun View?.firstAncestor(includeThis: Boolean = true, condition: (View) -> Boolean): View?
Link copied to clipboard
inline fun <T : View> View?.firstAncestorOfType(includeThis: Boolean = true): T?
Link copied to clipboard

Tries to find a view matching the check method or null if none is found

Link copied to clipboard
inline fun Container.fixedSizeCachedContainer(size: Size, cache: Boolean = true, clip: Boolean = true, callback: CachedContainer.() -> Unit = {}): FixedSizeCachedContainer
inline fun Container.fixedSizeCachedContainer(width: Double, height: Double, cache: Boolean = true, clip: Boolean = true, callback: CachedContainer.() -> Unit = {}): FixedSizeCachedContainer
Link copied to clipboard
inline fun Container.fixedSizeContainer(size: Size, clip: Boolean = false, callback: FixedSizeContainer.() -> Unit = {}): FixedSizeContainer
Link copied to clipboard
suspend fun forceLoadFontSource(currentVfs: VfsFile, sourceFile: String?)
Link copied to clipboard
inline fun View?.forEachAscendant(includeThis: Boolean = false, handler: (View) -> Unit)
Link copied to clipboard
inline fun forEachChild(callback: (child: View) -> Unit): Unit?

Iterates all the children of this container in normal order of rendering.

Link copied to clipboard
inline fun forEachChildren(callback: (child: View) -> Unit): Unit?

Iterates all the children of this container in normal order of rendering.

Link copied to clipboard
inline fun forEachChildrenReversed(callback: (child: View) -> Unit): Unit?

Iterates all the children of this container in reverse order of rendering.

Link copied to clipboard
inline fun forEachChildrenWithIndex(callback: (index: Int, child: View) -> Unit): Unit?

Iterates all the children of this container in normal order of rendering. Providing an index in addition to the child to the callback.

Link copied to clipboard
inline fun forEachChildReversed(callback: (child: View) -> Unit): Unit?

Iterates all the children of this container in reverse order of rendering.

Link copied to clipboard
inline fun forEachChildWithIndex(callback: (index: Int, child: View) -> Unit): Unit?

Iterates all the children of this container in normal order of rendering. Providing an index in addition to the child to the callback.

Link copied to clipboard
fun View?.foreachDescendant(handler: (View) -> Unit)

Iterates all the descendant Views including this calling the handler. Iteration happens in Pre-order (NLR).

Link copied to clipboard
inline fun <T> View.gamepad(callback: GamePadEvents.() -> T): T
Link copied to clipboard
inline fun <T> View.gestures(callback: GestureEvents.() -> T): T
Link copied to clipboard
operator fun get(index: Int): View

Alias for getChildAt

Link copied to clipboard
operator fun View?.get(name: String): QView

Indexer that allows to get a descendant marked with the name name.

Link copied to clipboard
fun getBounds(target: View? = this, doAnchoring: Boolean = true, inclusive: Boolean = false, includeFilters: Boolean = false): Rectangle
Link copied to clipboard
fun getBoundsInSpace(viewSpace: View?, doAnchoring: Boolean = true, includeFilters: Boolean = false): Rectangle

Get the bounds of the current this view in another view viewSpace.

Link copied to clipboard
fun getBoundsNoAnchoring(target: View? = this, inclusive: Boolean = false, includeFilters: Boolean = false): Rectangle

Get the bounds of this view, using the target view as coordinate system. Not providing a target will return the local bounds. Allows to specify out to prevent allocations.

Link copied to clipboard
fun getChildAt(index: Int): View

Finds the View at a given index. Remarks: if index is outside bounds 0..numChildren - 1, an IndexOutOfBoundsException will be thrown.

Link copied to clipboard
fun getChildAtOrNull(index: Int): View?

Finds the View at a given index. If the index is not valid, it returns null.

Link copied to clipboard

Finds the first child View matching a given name.

Link copied to clipboard
fun getChildIndex(view: View): Int

Retrieves the index of a given child View.

Link copied to clipboard
Link copied to clipboard
fun getConcatMatrix(target: View, inclusive: Boolean = false): Matrix

Gets the concatenated MMatrix of this View up to the target view. If inclusive is true, the concatenated matrix will include the target view too. Allows to define an out matrix that will hold the result to prevent allocations.

Link copied to clipboard
fun getConcatMatrixAccurateSlow(target: View, inclusive: Boolean = false): Matrix
Link copied to clipboard

Returns a list of descendants views that are of type T.

Link copied to clipboard
fun getGlobalBounds(includeFilters: Boolean = false): Rectangle

Returns the global bounds of this object.

Link copied to clipboard
Link copied to clipboard
fun getLocalBounds(doAnchoring: Boolean = true, includeFilters: Boolean = false): Rectangle

Get local bounds of the view.

Link copied to clipboard
open override fun getLocalBoundsInternal(): Rectangle
Link copied to clipboard
Link copied to clipboard
inline fun <T : ViewRenderPhase> getOrCreateAndAddRenderPhase(create: () -> T): T
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Converts the global point p (using root/stage as reference) into the local coordinate system. Allows to define out to avoid allocation.

Link copied to clipboard
Link copied to clipboard
inline fun Container.gpuGraphics(antialiased: Boolean = true, callback: ShapeBuilder.(GpuShapeView) -> Unit = {}): GpuShapeView
inline fun Container.gpuGraphics(shape: Shape, antialiased: Boolean = true, callback: GpuShapeView.() -> Unit = {}): GpuShapeView
inline fun Container.gpuGraphics(build: ShapeBuilder.() -> Unit, antialiased: Boolean = true, callback: GpuShapeView.() -> Unit = {}): GpuShapeView
Link copied to clipboard
inline fun Container.gpuShapeView(antialiased: Boolean = true, callback: ShapeBuilder.(GpuShapeView) -> Unit = {}): GpuShapeView
inline fun Container.gpuShapeView(shape: Shape, antialiased: Boolean = true, callback: GpuShapeView.() -> Unit = {}): GpuShapeView
inline fun Container.gpuShapeView(build: ShapeBuilder.() -> Unit, antialiased: Boolean = true, callback: GpuShapeView.() -> Unit = {}): GpuShapeView
Link copied to clipboard
inline fun Container.graphics(renderer: GraphicsRenderer = GraphicsRenderer.SYSTEM, callback: ShapeBuilder.(Graphics) -> Unit = {}): Graphics
inline fun Container.graphics(shape: Shape, renderer: GraphicsRenderer = GraphicsRenderer.SYSTEM, callback: Graphics.() -> Unit = {}): Graphics
inline fun Container.graphics(build: ShapeBuilder.() -> Unit, renderer: GraphicsRenderer = GraphicsRenderer.SYSTEM, callback: Graphics.() -> Unit = {}): Graphics
Link copied to clipboard
fun View.hasAncestor(ancestor: View): Boolean

Checks if this view has the specified ancestor.

Link copied to clipboard
open fun hitTest(globalPos: Point, direction: HitTestDirection = HitTestDirection.ANY): View?

Determines the view at the global point defined by xD and yD if any, or null

Link copied to clipboard
open override fun hitTestAny(p: Point, direction: HitTestDirection): Boolean
Link copied to clipboard
fun hitTestLocal(p: Point, direction: HitTestDirection = HitTestDirection.ANY): View?
Link copied to clipboard
fun hitTestShape(shape: Shape2D, matrix: Matrix, direction: HitTestDirection = HitTestDirection.ANY): View?
Link copied to clipboard
fun hitTestView(view: View, direction: HitTestDirection = HitTestDirection.ANY): View?
fun hitTestView(views: List<View>, direction: HitTestDirection = HitTestDirection.ANY): View?
Link copied to clipboard
inline fun Container.image(texture: Bitmap, anchor: Anchor = Anchor.TOP_LEFT, callback: Image.() -> Unit = {}): Image
inline fun Container.image(texture: Resourceable<out BaseBmpSlice>, anchor: Anchor = Anchor.TOP_LEFT, callback: Image.() -> Unit = {}): Image
inline fun Container.image(texture: BitmapCoords, anchor: Anchor = Anchor.TOP_LEFT, callback: Image.() -> Unit = {}): Image
Link copied to clipboard
inline fun Container.imageAnimationView(animation: ImageAnimation? = null, direction: ImageAnimation.Direction? = null, block: ImageAnimationView<Image>.() -> Unit = {}): ImageAnimationView<Image>
Link copied to clipboard
inline fun Container.imageDataView(data: ImageData? = null, animation: String? = null, playing: Boolean = false, smoothing: Boolean = true, block: ImageDataView.() -> Unit = {}): ImageDataView

With imageDataView it is possible to display an image inside a Container or View. It supports layers and animations. Animations consist of a series of frames which are defined e.g. by tag names in Aseprite files.

Link copied to clipboard
fun View.interval(time: TimeSpan, callback: () -> Unit): Closeable
Link copied to clipboard
fun View.intervalAndNow(time: TimeSpan, callback: () -> Unit): Closeable
Link copied to clipboard
open override fun invalidate()

Invalidates the View after changing some of its properties so the geometry can be computed again. If you change the localMatrix directly, you should call invalidateMatrix instead.

Link copied to clipboard
open override fun invalidateColorTransform()
Link copied to clipboard
Link copied to clipboard

Invalidates the localMatrix, so it gets updated from the decomposed properties: xD, yD, scaleXD, scaleYD, rotation, skewX and skewY.

Link copied to clipboard
open override fun invalidateRender()
Link copied to clipboard
fun View?.isDescendantOf(other: View, include: Boolean = true): Boolean
Link copied to clipboard
inline fun <T> View.keys(callback: KeysEvents.() -> T): T
Link copied to clipboard
inline fun Container.line(a: Point, b: Point, color: RGBA = Colors.WHITE, callback: Line.() -> Unit = {}): Line
inline fun Container.line(x0: Double, y0: Double, x1: Double, y1: Double, color: RGBA = Colors.WHITE, callback: Line.() -> Unit = {}): Line
Link copied to clipboard

Computes the local X and Y coordinates of the mouse using the coords from the Views object

Link copied to clipboard

Converts the local point p into a global point (using root/stage as reference). Allows to define out to avoid allocation.

Link copied to clipboard
fun localToWindow(views: Views, p: Point): Point

Converts the local point p into a point in window coordinates.

Link copied to clipboard
fun View.makeFocusable(tabIndex: Int = 0, onChanged: (value: Boolean) -> Unit = {}): UIFocusable
Link copied to clipboard
operator fun minusAssign(view: View)

Alias for removeChild.

Link copied to clipboard

x and y are in global coordinates

Link copied to clipboard
fun moveChildrenAt(from: Int, to: Int, count: Int = 1)
Link copied to clipboard
fun moveChildTo(view: View, index: Int)
Link copied to clipboard
inline fun View.newKeys(callback: KeysEvents.() -> Unit): KeysEvents
Link copied to clipboard
inline fun View.newMouse(callback: MouseEvents.() -> Unit): MouseEvents
Link copied to clipboard
inline fun View.nextView(filter: (View) -> Boolean): View?
Link copied to clipboard
inline fun <T> View.nextViewOfType(): T?
Link copied to clipboard
inline fun Container.ninePatch(ninePatch: NinePatchBmpSlice?, size: Size = Size(ninePatch?.widthF ?: 16f, ninePatch?.heightF ?: 16f), callback: NinePatch.() -> Unit = {}): NinePatch
inline fun Container.ninePatch(tex: BmpSlice, size: Size, left: Float, top: Float, right: Float, bottom: Float, callback: NinePatch.() -> Unit = {}): NinePatch
Link copied to clipboard
inline fun Container.ninePatchShapeView(shape: NinePatchShape, renderer: GraphicsRenderer = GraphicsRenderer.SYSTEM, callback: NinePatchShapeView.() -> Unit = {}): NinePatchShapeView
Link copied to clipboard
open fun onChildChangedSize(view: View)
Link copied to clipboard

Handles a DropFileEvent. The event happens when a drag&drop file over the window happens.

Link copied to clipboard
override fun <T : BEvent> onEvent(type: EventType<T>, handler: (T) -> Unit): CloseableCancellable

Registers a handler block to be executed when an event of type is dispatched

Link copied to clipboard
override fun onEventCount(type: EventType<*>): Int
Link copied to clipboard
open fun <T : BEvent> onEvents(vararg etypes: EventType<out T>, handler: (T) -> Unit): Closeable
Link copied to clipboard
Link copied to clipboard
inline fun Container.outline(vectorPath: VectorPath, x: Double = 0.0, y: Double = 0.0, color: RGBA = Colors.WHITE, callback: Outline.() -> Unit = {}): Outline
Link copied to clipboard
operator fun plusAssign(view: View)

Alias for addChild.

Link copied to clipboard
operator fun View?.plusAssign(view: View?)

Adds the specified view to this view only if this view is a Container.

Link copied to clipboard
inline fun View.prevView(filter: (View) -> Boolean): View?
Link copied to clipboard
inline fun <T> View.prevViewOfType(): T?
Link copied to clipboard
fun removeChild(view: View?): Boolean

Removes the specified view from this container.

Link copied to clipboard
fun removeChildAt(index: Int, count: Int)
Link copied to clipboard

Removes all Views children from this container.

Link copied to clipboard
inline fun removeChildrenIf(cond: (index: Int, child: View) -> Boolean): Boolean
Link copied to clipboard
fun View.removeFilter(filter: Filter)
Link copied to clipboard

Removes this view from its parent.

Link copied to clipboard
Link copied to clipboard
override fun render(ctx: RenderContext)

The render method that is in charge of rendering. This method receives the ctx that allows to buffer geometry to be drawn in batches.

Link copied to clipboard
inline fun Container.renderableView(size: Size = Size(128, 24), viewRenderer: ViewRenderer): RenderableView
inline fun Container.renderableView(size: Size = Size(128, 24), noinline viewRenderer: RenderableView.() -> Unit): RenderableView
Link copied to clipboard
Link copied to clipboard
inline fun View.renderCtx2d(ctx: RenderContext, crossinline block: (RenderContext2D) -> Unit)
Link copied to clipboard
open override fun renderDebug(ctx: RenderContext)
Link copied to clipboard
fun View.renderFiltered(ctx: RenderContext, filter: Filter, first: Boolean = true)
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
suspend fun View.renderToBitmap(views: Views? = this.stage?.views, region: Rectangle? = null, scale: Double = 1.0, outPoint: Ref<Point>? = null, includeBackground: Boolean = false): Bitmap32

Asynchronously renders this View (with the provided views) to a Bitmap32 and returns it. The rendering will happen before the next frame.

Link copied to clipboard

Converts a point p in the nearest ancestor marked as View.Reference into the local coordinate system. Allows to define out to avoid allocation.

Link copied to clipboard
fun replaceChild(old: View, new: View): Boolean

Replaces this child old with a new view.

Link copied to clipboard
inline fun <T : ViewRenderPhase> replaceRenderPhase(create: () -> T)
Link copied to clipboard

Replaces this view in its parent with view. Returns true if the replacement was successful. If this view doesn't have a parent or view is the same as this, returns false.

Link copied to clipboard
open fun reset()

Resets the View properties to an identity state.

Link copied to clipboard
inline fun Container.roundRect(size: Size, radius: RectCorners, fill: Paint = Colors.WHITE, stroke: Paint = Colors.WHITE, strokeThickness: Double = 0.0, autoScaling: Boolean = true, callback: RoundRect.() -> Unit = {}): RoundRect

Creates a new RoundRect of size widthxheight and color and allows you to configure it via callback. Once created, it is added to this receiver Container.

Link copied to clipboard
inline fun Container.scaleView(size: Size, scaleAvg: Double = 2.0, filtering: Boolean = false, callback: Container.() -> Unit = {}): ScaleView
Link copied to clipboard
inline suspend fun Container.sceneContainer(defaultTransition: Transition = AlphaTransition.withEasing(Easing.EASE_IN_OUT_QUAD), name: String = "sceneContainer", size: Size = Size.ZERO, callback: SceneContainer.() -> Unit = {}): SceneContainer

inline fun Container.sceneContainer(views: Views, defaultTransition: Transition = AlphaTransition.withEasing(Easing.EASE_IN_OUT_QUAD), name: String = "sceneContainer", size: Size = Size(0f, 0f), callback: SceneContainer.() -> Unit = {}): SceneContainer

Creates a new SceneContainer, allowing to configure with callback, and attaches the newly created container to the receiver this Container It requires to specify the Views singleton instance, and allows to specify a defaultTransition.

Link copied to clipboard

Scroll ancestors to make this view is visible

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
fun setFormat(face: Resourceable<out Font>? = this.font, size: Int = this.textSize.toInt(), color: RGBA = this.color, align: TextAlignment = this.alignment)
Link copied to clipboard

Tries to set the global bounds of the object. If there are rotations in the ancestors, this might not work as expected.

Link copied to clipboard
fun View?.setHtml(html: String)
Link copied to clipboard
fun setMatrix(matrix: Matrix)

Sets the local transform matrix that includes xD, yD, scaleXD, scaleYD, rotation, skewX and skewY encoded into a Matrix

Link copied to clipboard

Like setMatrix but directly sets an interpolated version of the l and r matrices with the ratio

Link copied to clipboard
Link copied to clipboard
fun View?.setText(text: String)
Link copied to clipboard
Link copied to clipboard

Sets the MatrixTransform decomposed version of the transformation, that directly includes xD, yD, scaleXD, scaleYD, rotation, skewX and skewY.

Link copied to clipboard
inline fun Container.shapeView(shape: VectorPath? = null, fill: Paint = Colors.WHITE, stroke: Paint = Colors.WHITE, strokeThickness: Double = 1.0, autoScaling: Boolean = true, renderer: GraphicsRenderer = GraphicsRenderer.GPU, callback: ShapeView.() -> Unit = {}): ShapeView
Link copied to clipboard
fun View.singleTouch(removeTouch: Boolean = false, supportStartAnywhere: Boolean = false, block: SingleTouchHandler.(id: Int) -> Unit)
Link copied to clipboard
inline fun Container.solidRect(size: Size, color: RGBA = Colors.WHITE, callback: SolidRect.() -> Unit = {}): SolidRect

Creates a new SolidRect of size and color color and allows you to configure it via callback. Once created, it is added to this receiver Container.

inline fun Container.solidRect(width: Double, height: Double, color: RGBA = Colors.WHITE, callback: SolidRect.() -> Unit = {}): SolidRect
inline fun Container.solidRect(width: Float, height: Float, color: RGBA = Colors.WHITE, callback: SolidRect.() -> Unit = {}): SolidRect

inline fun Container.solidRect(width: Int, height: Int, color: RGBA = Colors.WHITE, callback: SolidRect.() -> Unit = {}): SolidRect

Creates a new SolidRect of size widthxheight and color color and allows you to configure it via callback. Once created, it is added to this receiver Container.

Link copied to clipboard
inline fun Container.solidTriangle(p1: Point, p2: Point, p3: Point, color: RGBA = Colors.WHITE, callback: Mesh.() -> Unit = {}): SolidTriangle

Creates a new SolidTriangle with points [p1, p1, p3] and color color and allows you to configure it via callback. Once created, it is added to this receiver Container.

Link copied to clipboard
fun sortChildrenBy(comparator: Comparator<View>)

Sorts all the children by using the specified comparator.

Link copied to clipboard
inline fun Container.sprite(texture: Bitmap, anchor: Anchor = Anchor.TOP_LEFT, callback: Sprite.() -> Unit = {}): Sprite
inline fun Container.sprite(initialAnimation: SpriteAnimation, anchor: Anchor = Anchor.TOP_LEFT, callback: Sprite.() -> Unit = {}): Sprite
inline fun Container.sprite(texture: BmpSlice = Bitmaps.white, anchor: Anchor = Anchor.TOP_LEFT, callback: Sprite.() -> Unit = {}): Sprite
Link copied to clipboard
fun swapChildren(view1: View, view2: View)

Swaps the order of two child Views view1 and view2. If view1 or view2 are not part of this container, this method doesn't do anything.

Link copied to clipboard
fun swapChildrenAt(indexA: Int, indexB: Int)
fun swapChildrenAt(indexA: Int, indexB: Int, count: Int)
Link copied to clipboard
inline fun Container.text(text: String, textSize: Number = Text.DEFAULT_TEXT_SIZE, color: RGBA = Colors.WHITE, font: Resourceable<out Font> = DefaultTtfFontAsBitmap, alignment: TextAlignment = TextAlignment.TOP_LEFT, renderer: TextRenderer<String> = DefaultStringTextRenderer, autoScaling: Boolean = Text.DEFAULT_AUTO_SCALING, fill: Paint? = null, stroke: Stroke? = null, block: Text.() -> Unit = {}): Text
Link copied to clipboard
inline fun Container.textBlock(text: RichTextData = RichTextData("", textSize = 16.0, font = DefaultTtfFontAsBitmap), align: TextAlignment = TextAlignment.TOP_LEFT, size: Size = Size(100, 100), block: TextBlock.() -> Unit = {}): TextBlock
Link copied to clipboard
inline fun Container.tileMap(map: IStackedIntArray2, tileset: TileSet, repeatX: TileMapRepeat = TileMapRepeat.NONE, repeatY: TileMapRepeat = repeatX, smoothing: Boolean = true, tileSize: SizeInt = tileset.tileSize, callback: TileMap.() -> Unit = {}): TileMap
inline fun Container.tileMap(map: IntArray2, tileset: TileSet, repeatX: TileMapRepeat = TileMapRepeat.NONE, repeatY: TileMapRepeat = repeatX, smoothing: Boolean = true, tileSize: SizeInt = tileset.tileSize, callback: TileMap.() -> Unit = {}): TileMap
Link copied to clipboard
fun View.timeout(time: TimeSpan, callback: () -> Unit): Closeable
Link copied to clipboard
open override fun toString(): String
Link copied to clipboard
fun View.touch(block: TouchEvents.() -> Unit)
Link copied to clipboard
suspend fun BaseView?.tween(vararg vs: V2<*>, time: TimeSpan = DEFAULT_TIME, easing: Easing = DEFAULT_EASING, waitTime: TimeSpan = TimeSpan.NIL, timeout: Boolean = false, autoInvalidate: Boolean = true, callback: (Float) -> Unit = { })

Creates a tween that will take a specified time to execute, with an optional easing.

Link copied to clipboard
suspend fun BaseView?.tweenAsync(vararg vs: V2<*>, time: TimeSpan = DEFAULT_TIME, easing: Easing = DEFAULT_EASING, waitTime: TimeSpan = TimeSpan.NIL, callback: (Float) -> Unit = {}): Deferred<Unit>
fun BaseView?.tweenAsync(vararg vs: V2<*>, coroutineContext: CoroutineContext, time: TimeSpan = DEFAULT_TIME, easing: Easing = DEFAULT_EASING, waitTime: TimeSpan = TimeSpan.NIL, callback: (Float) -> Unit = {}): Deferred<Unit>
Link copied to clipboard
fun BaseView?.tweenNoWait(vararg vs: V2<*>, time: TimeSpan = DEFAULT_TIME, easing: Easing = DEFAULT_EASING, waitTime: TimeSpan = TimeSpan.NIL, callback: (Float) -> Unit = { }): TweenComponent?
Link copied to clipboard
inline fun <T> Container.uiBreadCrumb(path: UIBreadCrumb.Path<T>, block: UIBreadCrumb<T>.() -> Unit = {}): UIBreadCrumb<T>
inline fun <T> Container.uiBreadCrumb(path: Iterable<T>, block: UIBreadCrumb<T>.() -> Unit = {}): UIBreadCrumb<T>
Link copied to clipboard
inline fun <T> Container.uiBreadCrumbArray(vararg path: T, block: UIBreadCrumb<T>.() -> Unit = {}): UIBreadCrumb<T>
Link copied to clipboard
inline fun Container.uiButton(label: String = "", size: Size = UIButton.DEFAULT_SIZE, icon: BmpSlice? = null, block: UIButton.() -> Unit = {}): UIButton
Link copied to clipboard
inline fun Container.uiCheckBox(size: Size = UI_DEFAULT_SIZE, checked: Boolean = false, text: String = "CheckBox", block: UICheckBox.() -> Unit = {}): UICheckBox
Link copied to clipboard
inline fun <T> Container.uiComboBox(size: Size = UI_DEFAULT_SIZE, selectedIndex: Int = 0, items: List<T>, block: UIComboBox<T>.() -> Unit = {}): UIComboBox<T>
Link copied to clipboard
inline fun Container.uiContainer(size: Size = Size(128, 128), block: UIContainer.() -> Unit = {}): UIContainer
Link copied to clipboard
inline fun Container.uiEditableNumber(value: Double = 0.0, min: Double = 0.0, max: Double = 1.0, decimals: Int = 2, clamped: Boolean = true, size: Size = Size(64, 18), block: UIEditableNumber.() -> Unit = {}): UIEditableNumber
Link copied to clipboard
inline fun Container.uiFillLayeredContainer(size: Size = Size(128, 20), block: UIFillLayeredContainer.() -> Unit = {}): UIFillLayeredContainer
Link copied to clipboard
inline fun Container.uiGridFill(size: Size = Size(128, 128), cols: Int = 3, rows: Int = 3, spacing: Spacing = Spacing.ZERO, direction: UIDirection = UIDirection.ROW, block: UIGridFill.() -> Unit = {}): UIGridFill
Link copied to clipboard
inline fun Container.uiHorizontalFill(size: Size = Size(128, 20), padding: Number = UI_DEFAULT_PADDING, block: UIHorizontalFill.() -> Unit = {}): UIHorizontalFill
Link copied to clipboard
inline fun Container.uiHorizontalStack(height: Number? = null, padding: Number = UI_DEFAULT_PADDING, adjustHeight: Boolean = true, block: UIHorizontalStack.() -> Unit = {}): UIHorizontalStack
Link copied to clipboard
inline fun Container.uiImage(size: Size = UI_DEFAULT_SIZE, bitmap: BmpSlice = Bitmaps.transparent, scaleMode: ScaleMode = ScaleMode.NO_SCALE, contentAnchor: Anchor = Anchor.TOP_LEFT, block: UIImage.() -> Unit = {}): UIImage
Link copied to clipboard
inline fun Container.uiMaterialLayer(size: Size = UI_DEFAULT_SIZE, block: UIMaterialLayer.() -> Unit = {}): UIMaterialLayer
Link copied to clipboard
inline fun Container.uiOldScrollBar(size: Size, current: Double = 0.0, pageSize: Double = 1.0, totalSize: Double = 10.0, buttonSize: Double = 32.0, stepSize: Double = pageSize / 10.0, direction: UIOldScrollBar.Direction = Direction.auto(size), block: UIOldScrollBar.() -> Unit = {}): UIOldScrollBar
Link copied to clipboard
inline fun Container.uiProgressBar(size: Size = Size(256, 24), current: Number = 0.0, maximum: Number = 100.0, block: UIProgressBar.() -> Unit = {}): UIProgressBar
Link copied to clipboard
inline fun Container.uiPropertyCheckBox(title: String, vararg propsList: UIEditableBooleanProps, size: Size = Size(128, 20)): UIPropertyRow
Link copied to clipboard
inline fun <T : Enum<T>> Container.uiPropertyComboBox(title: String, field: KMutableProperty0<T>, size: Size = Size(128, 20)): UIPropertyRow
inline fun <T> Container.uiPropertyComboBox(title: String, field: KMutableProperty0<T>, values: List<T>, size: Size = Size(128, 20)): UIPropertyRow
Link copied to clipboard
inline fun Container.uiPropertyNumberRow(title: String, vararg propsList: UIEditableNumberProps, size: Size = Size(128, 20), block: UIPropertyNumberRow.() -> Unit = {}): UIPropertyNumberRow
Link copied to clipboard
inline fun Container.uiRadioButton(size: Size = UI_DEFAULT_SIZE, checked: Boolean = false, text: String = "Radio Button", group: UIRadioButtonGroup = UIRadioButtonGroup(), block: UIRadioButton.() -> Unit = {}): UIRadioButton
Link copied to clipboard
inline fun Container.uiScrollable(size: Size = Size(256, 256), config: UIScrollable.() -> Unit = {}, cache: Boolean = true, block: Container.(UIScrollable) -> Unit = {}): UIScrollable
Link copied to clipboard
inline fun Container.uiScrollableArea(size: Size = Size(256, 256), contentSize: Size = Size(512, 512), buttonSize: Number = 32.0, verticalScroll: Boolean = true, horizontalScroll: Boolean = true, config: UIScrollableArea.() -> Unit = {}, block: Container.(UIScrollableArea) -> Unit = {}): UIScrollableArea
Link copied to clipboard
inline fun Container.uiSlider(value: Number = UISlider.DEFAULT_VALUE, min: Number = UISlider.DEFAULT_MIN, max: Number = UISlider.DEFAULT_MAX, step: Number = UISlider.DEFAULT_STEP, decimalPlaces: Int? = null, size: Size = UISlider.DEFAULT_SIZE, block: UISlider.() -> Unit = {}): UISlider
Link copied to clipboard
inline fun Container.uiSpacing(size: Size = UI_DEFAULT_SIZE, block: UISpacing.() -> Unit = {}): UISpacing
Link copied to clipboard
inline fun Container.uiSwitch(size: Size = UI_DEFAULT_SIZE, checked: Boolean = false, text: String = "Switch", block: UISwitch.() -> Unit = {}): UISwitch
Link copied to clipboard
inline fun Container.uiText(text: String, size: Size = UIText.DEFAULT_SIZE, block: UIText.() -> Unit = {}): UIText
Link copied to clipboard
inline fun Container.uiTextInput(initialText: String = "", size: Size = Size(128, 24), block: UITextInput.() -> Unit = {}): UITextInput
Link copied to clipboard
Link copied to clipboard
inline fun <T> Container.uiTreeView(provider: UITreeViewProvider<T>, size: Size = Size(256, 256), block: Container.(UITreeView<T>) -> Unit = {}): UITreeView<T>
Link copied to clipboard
inline fun Container.uiVerticalFill(size: Size = Size(128, 20), padding: Number = UI_DEFAULT_PADDING, block: UIVerticalFill.() -> Unit = {}): UIVerticalFill
Link copied to clipboard
inline fun Container.uiVerticalList(provider: UIVerticalList.Provider, width: Number = 256.0, block: Container.(UIVerticalList) -> Unit = {}): UIVerticalList
Link copied to clipboard
inline fun Container.uiVerticalStack(width: Double? = null, padding: Double = UI_DEFAULT_PADDING, adjustSize: Boolean = true, block: UIVerticalStack.() -> Unit = {}): UIVerticalStack
Link copied to clipboard
inline fun Container.uiWindow(title: String, size: Size = Size(256, 256), configure: UIWindow.() -> Unit = {}, block: Container.(UIWindow) -> Unit = {}): UIWindow
Link copied to clipboard
operator fun <T : View> T.unaryPlus(): T

Equivalent to addChild

Link copied to clipboard
fun View.unsafeRenderToBitmapSync(ctx: RenderContext, region: Rectangle? = null, scale: Double = 1.0, outPoint: Ref<Point>? = null, useTexture: Boolean = true, bgcolor: RGBA = Colors.TRANSPARENT): Bitmap32
Link copied to clipboard
Link copied to clipboard
fun View.updateSingleView(delta: TimeSpan, tempUpdate: UpdateEvent = UpdateEvent())
Link copied to clipboard
Link copied to clipboard
inline fun Container.vectorImage(shape: SizedDrawable, autoScaling: Boolean = true, callback: VectorImage.() -> Unit = {}): VectorImage