TextureArraySpriteBatch

class TextureArraySpriteBatch(val context: Context, val size: Int = 1000, maxTextureSlots: Int, maxTextureWidth: Int, maxTextureHeight: Int, textureArrayMagFilter: TexMagFilter = TexMagFilter.NEAREST, textureArrayMinFilter: TexMinFilter = TexMinFilter.NEAREST) : Batch

Requires GLES 3.0!

Creates a new TextureArraySpriteBatch that is an optimized version of the SpriteBatch that maintains a texture-cache inside a GL.TEXTURE_2D_ARRAY to combine draw calls with different textures effectively.

Author

Colton Daily

Parameters

context

the context

size

the max number of sprites in a single batch. Max of 8191.

maxTextureSlots

the expected number of textures to be in use.

maxTextureWidth

the width of the largest texture

maxTextureHeight

the height of the largest texture

textureArrayMagFilter

the mag filter to use for the texture array

textureArrayMinFilter

the min filter to use for the texture array

Constructors

Link copied to clipboard
fun TextureArraySpriteBatch(context: Context, size: Int = 1000, maxTextureSlots: Int, maxTextureWidth: Int, maxTextureHeight: Int, textureArrayMagFilter: TexMagFilter = TexMagFilter.NEAREST, textureArrayMinFilter: TexMinFilter = TexMinFilter.NEAREST)

Types

Link copied to clipboard
object Companion

Functions

Link copied to clipboard
open override fun begin(projectionMatrix: Mat4?)
Link copied to clipboard
open override fun dispose()
Link copied to clipboard
open override fun draw(texture: Texture, spriteVertices: FloatArray, offset: Int, count: Int)
open fun draw(texture: Texture, x: Float, y: Float, originX: Float = 0.0f, originY: Float = 0.0f, width: Float = texture.width.toFloat(), height: Float = texture.height.toFloat(), scaleX: Float = 1.0f, scaleY: Float = 1.0f, rotation: Angle = Angle.ZERO, colorBits: Float = this.colorBits, flipX: Boolean = false, flipY: Boolean = false)
open override fun draw(slice: TextureSlice, x: Float, y: Float, originX: Float, originY: Float, width: Float, height: Float, scaleX: Float, scaleY: Float, rotation: Angle, colorBits: Float, flipX: Boolean, flipY: Boolean)
open override fun draw(texture: Texture, x: Float, y: Float, originX: Float, originY: Float, width: Float, height: Float, scaleX: Float, scaleY: Float, rotation: Angle, srcX: Int, srcY: Int, srcWidth: Int, srcHeight: Int, colorBits: Float, flipX: Boolean, flipY: Boolean)
open override fun draw(slice: TextureSlice, x: Float, y: Float, originX: Float, originY: Float, width: Float, height: Float, scaleX: Float, scaleY: Float, rotation: Angle, colorBits: Float, srcX: Int, srcY: Int, srcWidth: Int, srcHeight: Int, flipX: Boolean, flipY: Boolean)
Link copied to clipboard
open override fun end()
Link copied to clipboard
open override fun flush()
Link copied to clipboard
open override fun setBlendFunction(src: BlendFactor, dst: BlendFactor)
Link copied to clipboard
open override fun setBlendFunctionSeparate(srcFuncColor: BlendFactor, dstFuncColor: BlendFactor, srcFuncAlpha: BlendFactor, dstFuncAlpha: BlendFactor)
Link copied to clipboard
open override fun setToPreviousBlendFunction()
Link copied to clipboard
open override fun useDefaultShader()

Properties

Link copied to clipboard
open override var color: Color
Link copied to clipboard
open override var colorBits: Float
Link copied to clipboard
Link copied to clipboard
open override val drawing: Boolean
Link copied to clipboard
Link copied to clipboard
open override var projectionMatrix: Mat4
Link copied to clipboard
var renderCalls: Int = 0
Link copied to clipboard
open override var shader: ShaderProgram<*, *>
Link copied to clipboard
val size: Int = 1000
Link copied to clipboard
Link copied to clipboard
open override var transformMatrix: Mat4