Skip to content

Transparency

class Transparency(alpha: Int = 0) : Component()
Example
on_npc_option(Assets.Npc.goblin.id, "Banish") { player ->
val alpha = target.findComponent<Transparency>() ?: Transparency().also { target.addComponent(it) }
alpha.fade(to = Transparency.INVISIBLE, overCycles = 100)
}
var alpha: Int
val fading: Boolean
fun fade(
to: Int,
overCycles: Int,
from: Int? = null
)
override fun onComponentRemovedFromEntity()
const val OPAQUE: Int = 0
const val INVISIBLE: Int = 255
const val MAX_CYCLES: Int = 0x7FFF