mirror of
https://github.com/curioustorvald/Terrarum.git
synced 2026-06-14 20:44:05 +09:00
sprite: emissive layer
This commit is contained in:
@@ -33,6 +33,7 @@ open class ParticleBase(renderOrder: Actor.RenderOrder, var despawnUponCollision
|
||||
|
||||
open lateinit var body: TextureRegion // you might want to use SpriteAnimation
|
||||
open var glow: TextureRegion? = null
|
||||
open var emissive: TextureRegion? = null
|
||||
|
||||
val drawColour = Color(1f, 1f, 1f, 1f)
|
||||
|
||||
@@ -92,6 +93,15 @@ open class ParticleBase(renderOrder: Actor.RenderOrder, var despawnUponCollision
|
||||
}
|
||||
}
|
||||
|
||||
open fun drawEmissive(frameDelta: Float, batch: SpriteBatch) {
|
||||
if (!flagDespawn && emissive != null) {
|
||||
batch.color = drawColour
|
||||
drawBodyInGoodPosition(hitbox.startX.toFloat(), hitbox.startY.toFloat()) { x, y ->
|
||||
batch.draw(emissive, x, y, hitbox.width.toFloat(), hitbox.height.toFloat())
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
open fun dispose() {
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user