Package-level declarations

Types

Link copied to clipboard
Link copied to clipboard

Class in charge of automatically handling AGTexture<->Bitmap conversion.

Link copied to clipboard
class AgBufferManager(val ag: AG)

Class to handle cached buffers, that are freed after a few frames of not being used

Link copied to clipboard
class AgCachedBuffer(val data: Buffer)
Link copied to clipboard
class BatchBuilder2D(val ctx: RenderContext, val reqMaxQuads: Int = DEFAULT_BATCH_QUADS)

Allows to draw quads and sprites buffering the geometry to limit the draw batches executed calling AG (Accelerated Graphics). This class handles a vertex structure of: x, y, u, v, colorMul. Allowing to draw texturized and tinted primitives.

Link copied to clipboard
Link copied to clipboard

A context that allows to draw lines using AG (Accelerated Graphics).

Link copied to clipboard
Link copied to clipboard
class RenderContext(val ag: AG, val bp: BoundsProvider = BoundsProvider.Base(), val deviceDimensionsProvider: DeviceDimensionsProvider = (bp as? DeviceDimensionsProvider?) ?: DeviceDimensionsProvider.DEFAULT, val stats: Stats = Stats(), val coroutineContext: CoroutineContext = EmptyCoroutineContext, val batchMaxQuads: Int = BatchBuilder2D.DEFAULT_BATCH_QUADS, val windowConfig: GameWindowConfig = GameWindowConfig.Impl()) : Extra, BoundsProvider, AGFeatures, DeviceDimensionsProvider, Closeable

A context that allows to render objects.

Link copied to clipboard
class RenderContext2D(val batch: BatchBuilder2D, val agBitmapTextureManager: AgBitmapTextureManager) : Extra

Helper class using BatchBuilder2D that keeps a chain of affine transforms MMatrix, ColorTransform and blendMode and allows to draw images and scissors with that transform.

Link copied to clipboard
Link copied to clipboard
class ShrinkableTexturedVertexArray(val vertices: TexturedVertexArray, var vcount: Int = 0, var icount: Int = 0)
Link copied to clipboard
Link copied to clipboard
class TextureBase(var base: AGTexture?, var size: SizeInt) : Closeable, SizeableInt

Represents a full texture region wraping a base and specifying its width and height

Link copied to clipboard
Link copied to clipboard
class TexturedVertexArray(vcount: Int, val indices: ShortArray, icount: Int = indices.size)

Allows to build a set of textured and colored vertices. Where vcount is the number of vertices and icount, the maximum number of indices.

Link copied to clipboard
data class TextureWithBitmapSlice(val texture: BmpSlice, val bitmapSlice: BmpSlice, val scale: Double, val bounds: Rectangle)

A texture wrap that includes scale and bounds information. Used internally for atlases.

Link copied to clipboard
data class VertexInfo(var x: Float = 0.0f, var y: Float = 0.0f, var u: Float = 0.0f, var v: Float = 0.0f, var colorMul: RGBA = Colors.WHITE)

Properties

Link copied to clipboard

Functions

Link copied to clipboard
Link copied to clipboard
fun RenderContext2D.drawText(placements: RichTextDataPlacements, textRangeStart: Int = 0, textRangeEnd: Int = Int.MAX_VALUE)
fun RenderContext2D.drawText(text: String, font: BitmapFont, textSize: Double = 16.0, pos: Point = Point.ZERO, color: RGBA = Colors.WHITE, baseline: Boolean = false, textRangeStart: Int = 0, textRangeEnd: Int = Int.MAX_VALUE)
fun RenderContext2D.drawText(text: RichTextData, pos: Point = Point.ZERO, size: Size = Size(10000, 10000), wordWrap: Boolean = true, includePartialLines: Boolean = false, ellipsis: String? = null, fill: Paint? = null, stroke: Stroke? = null, align: TextAlignment = TextAlignment.TOP_LEFT, includeFirstLineAlways: Boolean = true)
Link copied to clipboard

Returns this same bitmap if it is already power of two, or creates a new Bitmap32 with the pixels from this set at the top-left while keeping the rest of the Bitmap32 with transparent pixels.

Link copied to clipboard
fun RenderContext2D.materialRoundRect(x: Double, y: Double, width: Double, height: Double, color: RGBA = Colors.RED, radius: RectCorners = RectCorners.EMPTY, shadowOffset: Point = Point.ZERO, shadowColor: RGBA = Colors.BLACK, shadowRadius: Double = 0.0, highlightPos: Point = Point.ZERO, highlightRadius: Double = 0.0, highlightColor: RGBA = Colors.WHITE, borderSize: Double = 0.0, borderColor: RGBA = Colors.WHITE)
Link copied to clipboard
inline fun View.renderCtx2d(ctx: RenderContext, crossinline block: (RenderContext2D) -> Unit)
Link copied to clipboard
inline fun testRenderContext(bp: BoundsProvider = BoundsProvider.Base(), block: (RenderContext) -> Unit): AGLog
inline fun <T : AG> testRenderContext(ag: T, bp: BoundsProvider = BoundsProvider.Base(), block: (RenderContext) -> Unit): T
Link copied to clipboard
fun Texture(frameBuffer: AGFrameBuffer): Texture

Creates a Texture from a frame buffer frameBuffer with the right size of the frameBuffer.

fun Texture(agBase: AGTexture, width: Int, height: Int): Texture

Creates a Texture from a texture agBase and its wanted size width, height.

fun Texture(base: TextureBase, left: Int = 0, top: Int = 0, right: Int = base.width, bottom: Int = base.height): Texture
Link copied to clipboard
fun Texture.update(bmp: Bitmap32, mipmaps: Boolean, baseMipmapLevel: Int, maxMipmapLevel: Int)

Updates this texture from a bmp and optionally generates mipmaps.

Link copied to clipboard
inline fun RenderContext.useLineBatcher(matrix: Matrix? = null, block: (LineRenderBatcher) -> Unit)