Package-level declarations

Types

Link copied to clipboard
interface Anchorable
Link copied to clipboard
inline class AnimationType(val id: Int)
Link copied to clipboard
abstract class BaseGraphics(var autoScaling: Boolean = false) : BaseImage
Link copied to clipboard
open class BaseImage(bitmap: Resourceable<out BitmapCoords>, anchor: Anchor = Anchor.TOP_LEFT, hitShape: VectorPath? = null, var smoothing: Boolean = true) : RectBase
Link copied to clipboard
Link copied to clipboard
data class BlendMode(val factors: AGBlending, val name: String? = null)

Determines how pixels should be blended. The most common blend modes are: NORMAL (normal mix) and ADD (additive blending) along with MULTIPLY and others.

Link copied to clipboard
interface BoundsProvider
Link copied to clipboard
interface BView
Link copied to clipboard
open class CachedContainer(var cache: Boolean = true, renderQuality: Quality? = null) : Container, InvalidateNotifier
Link copied to clipboard

A Camera is a Container that allows to center its position using setTo and tweenTo methods.

Link copied to clipboard
open class Circle(radius: Double = 16.0, fill: Paint = Colors.WHITE, stroke: Paint = Colors.WHITE, strokeThickness: Double = 0.0, autoScaling: Boolean = true, renderer: GraphicsRenderer = GraphicsRenderer.GPU) : ShapeView

A CpuGraphics class that automatically keeps a circle shape with radius and color. The autoScaling property determines if the underlying texture will be updated when the hierarchy is scaled.

Link copied to clipboard
open class ClipContainer(size: Size = Size(100, 100)) : FixedSizeContainer
Link copied to clipboard
open class Container(var cull: Boolean = false) : View

A simple container of Views.

Link copied to clipboard

Allows to safely interact with the children of a container instance.

Link copied to clipboard
open class CpuGraphics @JvmOverloads constructor(var autoScaling: Boolean = false) : BaseGraphics
Link copied to clipboard
Link copied to clipboard
open class DummyView : View

A Dummy view that doesn't render anything.

Link copied to clipboard
open class Ellipse(radius: Size = Size(16, 16), fill: Paint = Colors.WHITE, stroke: Paint = Colors.WHITE, strokeThickness: Double = 0.0, autoScaling: Boolean = true) : ShapeView

A CpuGraphics class that automatically keeps a ellipse shape with radiusX, radiusY and color. The autoScaling property determines if the underlying texture will be updated when the hierarchy is scaled.

Link copied to clipboard
open class FastEllipse(size: Size = Size(100f, 100f)) : FastRoundRectBase
Link copied to clipboard
open class FastRoundRect(size: Size = Size(100f, 100f), corners: RectCorners = RectCorners(.1f, .1f, 1f, 1f)) : FastRoundRectBase
Link copied to clipboard
abstract class FastRoundRectBase(size: Size = Size(100f, 100f), cornersRatio: RectCorners = RectCorners(.0f, .0f, .0f, .0f), doScale: Boolean = true) : ShadedView
Link copied to clipboard
Link copied to clipboard
open class FixedSizeCachedContainer(size: Size = Size(100, 100), var cache: Boolean = true, var clip: Boolean = true) : CachedContainer, View.Reference
Link copied to clipboard
open class FixedSizeContainer(size: Size = Size(100, 100), var clip: Boolean = false) : Container, View.Reference
Link copied to clipboard
Link copied to clipboard
class Graphics(shape: Shape = EmptyShape, renderer: GraphicsRenderer = GraphicsRenderer.GPU) : Container, ViewLeaf, Anchorable
Link copied to clipboard
Link copied to clipboard
interface IHtml
Link copied to clipboard
class Image(bitmap: Resourceable<out BitmapCoords>, anchor: Anchor = Anchor.TOP_LEFT, hitShape: VectorPath? = null, var smoothing: Boolean = true) : BaseImage, ViewFileRef, SmoothedBmpSlice
Link copied to clipboard
Link copied to clipboard
interface IText
Link copied to clipboard
data class KorgeFileLoader<T>(val name: String, val loader: suspend VfsFile.(FastByteArrayInputStream, Views) -> T)
Link copied to clipboard
data class KorgeFileLoaderTester<T>(val name: String, val tester: suspend (s: FastByteArrayInputStream, injector: Injector) -> KorgeFileLoader<T>?)
Link copied to clipboard
class Line(p1: Point, var p2: Point, color: RGBA = Colors.WHITE) : View
Link copied to clipboard
open class Mesh(var texture: BmpSlice? = null, var vertices: Float32Buffer = Float32Buffer(0), var uvs: Float32Buffer = Float32Buffer(0), var indices: Uint16Buffer = Uint16Buffer(0), var drawMode: Mesh.DrawModes = DrawModes.Triangles) : View
Link copied to clipboard
class NinePatch(ninePatch: NinePatchBmpSlice?, size: Size = Size(ninePatch?.width?.toFloat() ?: 16f, ninePatch?.height?.toFloat() ?: 16f)) : View, ViewFileRef
Link copied to clipboard
Link copied to clipboard
class Outline(vectorPath: VectorPath, x: Double = 0.0, y: Double = 0.0, color: RGBA = Colors.WHITE) : View
Link copied to clipboard
interface PixelAnchorable
Link copied to clipboard
class QView(val views: List<View>) : List<View> , BView
Link copied to clipboard
open class RectBase(anchor: Anchor = Anchor.TOP_LEFT, hitShape: VectorPath? = null, var smoothing: Boolean = true) : View, Anchorable

RectBase is an abstract Container that represents something with a Rect-like shape: like a SolidRect or an Image. It supports anchoring anchor for this rectangle, and handles pre-computing of vertices for performance.

Link copied to clipboard
interface Renderable

Represents something that can be rendered. Usually a View.

Link copied to clipboard
Link copied to clipboard
class RoundRect(size: Size, radius: RectCorners, fill: Paint = Colors.WHITE, stroke: Paint = Colors.WHITE, strokeThickness: Double = 0.0, autoScaling: Boolean = true) : ShapeView

A Rect View with rounded corners of size widthD and heightD with the initial color.

Link copied to clipboard
class ScaleView(size: Size, scaleAvg: Double = 2.0, var filtering: Boolean = false) : SContainer, View.Reference
Link copied to clipboard
sealed class ScalingOption
Link copied to clipboard
open class SContainer(size: Size = Size(100, 100), var clip: Boolean = false) : FixedSizeContainer
Link copied to clipboard
open class ShadedView(program: Program, size: Size = Size(100f, 100f), coordsType: ShadedView.CoordsType = CoordsType.D_0_1) : RectBase
Link copied to clipboard
open class ShapeView(shape: VectorPath? = null, fill: Paint = Colors.WHITE, stroke: Paint = Colors.WHITE, strokeThickness: Double = 1.0, autoScaling: Boolean = true, renderer: GraphicsRenderer = GraphicsRenderer.GPU) : Container, Anchorable, ViewLeaf
Link copied to clipboard
Link copied to clipboard
class SolidRect(size: Size, color: RGBA = Colors.WHITE) : RectBase

A Rect RectBase of size widthD and heightD with the initial color, color.

Link copied to clipboard
class SolidTriangle(p1: Point, p2: Point, p3: Point, color: RGBA = Colors.WHITE) : Mesh
Link copied to clipboard
open class Sprite(bitmap: BmpSlice = Bitmaps.white, anchor: Anchor = Anchor.TOP_LEFT, hitShape: VectorPath? = null, var smoothing: Boolean = true) : BaseImage

A Sprite is basically an Image with added abilities to display a SpriteAnimation The regular usage is to initialize the Sprite with one SpriteAnimation. The first displayed bitmap will be the first element of the SpriteAnimations spriteStack.

Link copied to clipboard
class SpriteAnimation(val sprites: List<BmpSlice>, val defaultTimePerFrame: TimeSpan = TimeSpan.NIL) : Collection<BmpSlice>
Link copied to clipboard

Singleton root View and Container that contains a reference to the Views singleton and doesn't have any parent.

Link copied to clipboard
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
Link copied to clipboard
class TextBlock(text: RichTextData = RichTextData("", textSize = 16.0, font = DefaultTtfFontAsBitmap), align: TextAlignment = TextAlignment.TOP_LEFT, size: Size = Size(100, 100)) : UIView, ViewLeaf
Link copied to clipboard
class UpdateEvent(var deltaTime: TimeSpan = TimeSpan.ZERO) : Event, TEvent<UpdateEvent>
Link copied to clipboard
class VectorImage(shape: SizedDrawable, var autoScaling: Boolean = true) : BaseGraphics, ViewFileRef
Link copied to clipboard

KorGE includes a DOM-based tree of views that makes a chain of affine transforms starting with the Stage, that is the root node.

Link copied to clipboard
data class ViewFactory(val name: String, val build: () -> View)
Link copied to clipboard
interface ViewFileRef
Link copied to clipboard
interface ViewLeaf
Link copied to clipboard
fun interface ViewRenderer
Link copied to clipboard
interface ViewRenderPhase
Link copied to clipboard
class Views(val coroutineContext: CoroutineContext, val ag: AG, val injector: Injector = Injector(), val input: Input = Input(), val timeProvider: TimeProvider = TimeProvider, val stats: Stats = Stats(), val gameWindow: GameWindow, val gameId: String = "korgegame", val settingsFolder: String? = null, val batchMaxQuads: Int = BatchBuilder2D.DEFAULT_BATCH_QUADS, val bp: BoundsProvider = BoundsProvider.Base(), val stageBuilder: (Views) -> Stage = { Stage(it) }) : BaseEventListener, Extra, CoroutineScope, ViewsContainer, BoundsProvider, DialogInterfaceProvider, Closeable, ResourcesContainer, InvalidateNotifier, DeviceDimensionsProvider

Heavyweight singleton object within the application that contains information about the Views. It contains information about the coroutineContext, the gameWindow, the injector, the input and contains a reference to the root view.

Link copied to clipboard
interface ViewsContainer
Link copied to clipboard
class ViewsLog(val coroutineContext: CoroutineContext, val injector: Injector = Injector(), val ag: AG = AGLog(), val input: Input = Input(), val timeProvider: TimeProvider = TimeProvider, val stats: Stats = Stats(), val gameWindow: GameWindow = GameWindowLog()) : CoroutineScope
Link copied to clipboard
class ViewsResizedEvent(val views: Views, var size: SizeInt = SizeInt(0, 0)) : Event, TEvent<ViewsResizedEvent>
Link copied to clipboard
class ViewsUpdateEvent(val views: Views, var delta: TimeSpan = TimeSpan.ZERO) : Event, TEvent<ViewsUpdateEvent>

Properties

Link copied to clipboard
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

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
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Functions

Link copied to clipboard
fun <T : View> T.addFixedUpdater(timesPerSecond: Frequency, initial: Boolean = true, limitCallsPerFrame: Int = 16, updatable: T.() -> Unit): Cancellable

fun <T : View> T.addFixedUpdater(time: TimeSpan, first: Boolean = true, limitCallsPerFrame: Int = 16, updatable: T.() -> Unit): CloseableCancellable

Adds an updatable block that will be executed every time time, the calls will be discretized on each frame and will handle accumulations. The first properly allows to adjust if the updatable will be called immediately after calling this function. To avoid executing too many blocks, when there is a long pause, limitCallsPerFrame limits the number of times the block can be executed in a single frame.

Link copied to clipboard
fun <T : View> T.addOptFixedUpdater(time: TimeSpan = TimeSpan.NIL, updatable: T.(TimeSpan) -> Unit): CloseableCancellable
Link copied to clipboard
fun <T : View> T.addTo(parent: Container): T

Alias for parent += this. Refer to Container.plusAssign.

inline fun <T : View> T.addTo(instance: Container, callback: T.() -> Unit = {}): T
Link copied to clipboard
fun <T : View> T.addUpdater(updatable: T.(TimeSpan) -> Unit): CloseableCancellable
fun <T : View> T.addUpdater(referenceFps: Frequency, first: Boolean = true, updatable: T.(scale: Float) -> Unit): Cancellable

fun <T : View> T.addUpdater(first: Boolean = true, firstTime: TimeSpan = TimeSpan.ZERO, updatable: T.(TimeSpan) -> Unit): CloseableCancellable

Adds a block that will be executed per frame to this view. As parameter the block will receive a TimeSpan with the time elapsed since the previous frame.

Link copied to clipboard
fun <T : View> T.addUpdaterWithViews(updatable: T.(views: Views, TimeSpan) -> Unit): CloseableCancellable
Link copied to clipboard
fun View?.allDescendants(out: ArrayList<View> = arrayListOf()): List<View>
Link copied to clipboard
fun <T : View> T.alpha(alpha: Float): T

Chainable method returning this that sets View.alphaF

inline fun <T : View> T.alpha(alpha: Number): T
fun QView.alpha(value: Double)
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
fun <T : Anchorable> T.anchor(anchor: Anchor): T
inline fun <T : Anchorable> T.anchor(ax: Number, ay: Number): T
Link copied to clipboard
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
fun <T : Text> T.aroundPath(path: VectorPath?): T
Link copied to clipboard
fun <T : Text> T.autoSize(value: Boolean): T
Link copied to clipboard
inline fun <T : View> T.blendMode(blendMode: BlendMode): T
Link copied to clipboard
fun <T : View> T.bounds(rect: Rectangle): T
fun <T : View> T.bounds(left: Double, top: Double, right: Double, bottom: Double): T
inline fun <T : View> T.bounds(left: Number, top: Number, right: Number, bottom: Number): 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 <T : View> QView.castTo(): T?
Link copied to clipboard
fun <T : Anchorable> T.center(): T
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
inline fun Container.clipContainer(size: Size, callback: ClipContainer.() -> Unit = {}): ClipContainer
Link copied to clipboard
fun <T : View> T.colorMul(color: RGBA): T

Chainable method returning this that sets View.colorMul

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
fun View.Companion.convertViewSpace(src: View, srcPoint: Point, dst: View?): Point
Link copied to clipboard
fun CpuGraphics(shape: Shape, antialiased: Boolean = true): CpuGraphics
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
fun <T : View> T.deferWithViews(views: Views? = null, tryImmediate: Boolean = true, block: (views: Views) -> Unit): T

Registers a block that will be executed once in the next frame that this View is displayed with the Views singleton

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
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
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 <T2 : View, T> extraViewProp(name: String? = null, noinline default: T2.() -> T): Extra.PropertyThis<T2, T>
Link copied to clipboard
inline fun Container.fastEllipse(size: Size, color: RGBA = Colors.WHITE, callback: FastEllipse.() -> Unit = {}): FastEllipse
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
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
inline fun View?.forEachAscendant(includeThis: Boolean = false, handler: (View) -> Unit)
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
operator fun View?.get(name: String): QView

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

Link copied to clipboard
fun getAllDescendantViews(view: View, out: FastArrayList<View> = FastArrayList(), reversed: Boolean = true): FastArrayList<View>
Link copied to clipboard

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

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
fun Atlas.getSpriteAnimation(prefix: String = "", defaultTimePerFrame: TimeSpan = TimeSpan.NIL): SpriteAnimation
fun Atlas.getSpriteAnimation(regex: Regex, defaultTimePerFrame: TimeSpan = TimeSpan.NIL): SpriteAnimation
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
fun <T : View> T.globalPos(p: Point): T
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
inline fun <T : View> T.hitShape(crossinline block: VectorBuilder.() -> Unit): T
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
fun View?.isDescendantOf(other: View, include: Boolean = true): Boolean
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
inline fun <T : View> T.name(name: String?): T
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
fun QView.onClick(handler: suspend (MouseEvents) -> Unit)
Link copied to clipboard
inline fun <T : View> T.onFrame(noinline updatable: T.(TimeSpan) -> Unit): Cancellable
Link copied to clipboard
fun <T : View> T.onNextFrame(block: T.(views: Views) -> Unit): CloseableCancellable
Link copied to clipboard
fun <T : View> T.onStageResized(firstTrigger: Boolean = true, block: Views.(width: Int, height: Int) -> Unit): T
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
fun <T : Mesh> T.pivot(x: Double, y: Double): T
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
fun <T : View> T.position(p: Point): T

Chainable method returning this that sets View.x and View.y

fun <T : View> T.position(x: Double, y: Double): T
inline fun <T : View> T.position(x: Number, y: Number): T
Link copied to clipboard
fun <T : View> T.positionX(x: Double): T
inline fun <T : View> T.positionX(x: Number): T
Link copied to clipboard
fun <T : View> T.positionY(y: Double): T
inline fun <T : View> T.positionY(y: Number): T
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
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
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

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
fun <T : View> T.rotation(rot: Angle): T

Chainable method returning this that sets View.rotation

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
fun <T : View> T.scale(sx: Double, sy: Double = sx): T

Chainable method returning this that sets View.scaleXD and View.scaleYD

inline fun <T : View> T.scale(sx: Number, sy: Number = sx): T
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
Link copied to clipboard

Scroll ancestors to make this view is visible

Link copied to clipboard
fun BoundsProvider.setBoundsInfo(reqVirtualSize: Size, actualSize: Size, scaleMode: ScaleMode = ScaleMode.FILL, anchor: Anchor = Anchor.CENTER, virtualSize: Ref<SizeInt> = Ref(), targetSize: Ref<SizeInt> = Ref())
Link copied to clipboard
fun QView.setHtml(html: String)
fun View?.setHtml(html: String)
Link copied to clipboard
Link copied to clipboard
fun QView.setText(text: String)
fun View?.setText(text: String)
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 <T : View> T.size(size: Size): T
fun <T : View> T.size(width: Double, height: Double): T
inline fun <T : View> T.size(width: Number, height: Number): T
Link copied to clipboard
fun <T : View> T.sizeScaled(size: Size): T
Link copied to clipboard
fun <T : View> T.skew(sx: Angle, sy: Angle): T

Chainable method returning this that sets View.skewX and View.skewY

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
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
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
fun <T : Text> T.textSpacing(spacing: Float): T
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
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
Link copied to clipboard
suspend fun views(): Views
Link copied to clipboard
fun viewsLog(callback: suspend Stage.(log: ViewsLog) -> Unit): AsyncEntryPointResult
Link copied to clipboard
suspend fun viewsLogSuspend(callback: suspend Stage.(log: ViewsLog) -> Unit)
Link copied to clipboard
inline fun <T : View> T.visible(visible: Boolean): T

Sets the position point of the view and returns this (chaineable).

fun QView.visible(value: Boolean)
Link copied to clipboard
fun <T : View> T.xy(p: MPoint): T
fun <T : View> T.xy(x: Double, y: Double): T
inline fun <T : View> T.xy(x: Number, y: Number): T

fun <T : View> T.xy(p: Point): T

Chainable method returning this that sets View.x and View.y

Link copied to clipboard
fun <T : View> T.zIndex(index: Double): T
inline fun <T : View> T.zIndex(index: Number): T