API reference
API reference
Select your platform
No SDKs available
No versions available

SceneTexture

SceneTexture

class SceneTexture
The SceneTexture class represents a texture resource. SceneTextures are used to construct SceneMaterials and can be used as inputs for shaders also in the construction of SceneMaterials.
Example ways to create a SceneTexture:
SceneTexture(getDrawable(R.drawable.myDrawable)) // Creating a SceneTexture from drawable in resources
SceneTexture(Color.valueOf(Color.BLACK)) // Creating a plain black SceneTexture
SceneTextures are also generated as part of the Panel rendering process and are used to render Panels by populating their SceneMaterial. This is not necessary for Layer panels, but can be enabled with PanelConfigOptions "forceSceneTexture" parameter.

Constructors

NameSummary
SceneTexture
constructor(width: Int, height: Int, numberOfMips: Int, samplerConfig: SamplerConfig = SamplerConfig())constructor(image: <Error class: unknown class>, samplerConfig: SamplerConfig = SamplerConfig())constructor(bitmap: <Error class: unknown class>, samplerConfig: SamplerConfig = SamplerConfig())constructor(drawable: <Error class: unknown class>?)constructor(color: <Error class: unknown class>, samplerConfig: SamplerConfig = SamplerConfig())

Types

NameSummary
Companion
object Companion

Properties

NameSummary
handle
var handle: Long

Functions

NameSummary
destroy
fun destroy()
nativeHandle
fun nativeHandle(): Long
update
fun update(buffer: ByteBuffer, width: Int, height: Int, strideInBytes: Int)

Updates the texture with new data.

Companion

object Companion

Functions

NameSummary
calculateMips
fun calculateMips(w: Int, h: Int): Int

Calculates the number of mipmap levels for a texture of the given dimensions.
createFromPlatformImage
fun createFromPlatformImage(w: Int, h: Int, mips: Int, platformImage: Long, samplerConfig: SamplerConfig = SamplerConfig()): SceneTexture
Did you find this page helpful?
Thumbs up icon
Thumbs down icon