Back to Filament

build

docs/android/dokka/filament-android/com.google.android.filament/-light-manager/-builder/build.md

1.75.01.0 KB
Original Source

//filament-android/com.google.android.filament/LightManager/Builder/build

build

[main]
open fun build(engine: Engine, entity: Int)

Adds the Light component to an entity.

If this component already exists on the given entity, it is first destroyed as if destroy was called.

warning: Currently, only 2048 lights can be created on a given Engine.

Parameters

main

engineReference to the Engine to associate this light with.
entityEntity to add the light component to.

Throws

RuntimeExceptionif a runtime error occurred, such as running out of memory or other resources, or if a parameter to a builder function was invalid.