commonMain.ru.casperix.spine.Slot.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of spine-jvm Show documentation
Show all versions of spine-jvm Show documentation
Signals for all occasions
package ru.casperix.spine
import ru.casperix.math.color.Color
import ru.casperix.math.color.Colors
class Slot(
val skeleton: Skeleton,
val data: SlotData,
val bone: Bone,
) {
var attachment: Attachment? = null
var color: Color = Colors.WHITE
var darkColor: Color? = null
var deform = FloatArray(0)
var sequenceIndex: Int = -1
init {
setToSetupPose()
}
fun setToSetupPose() {
color = data.color
if (darkColor != null) darkColor = data.darkColor
attachment = data.attachmentName.let {
if (it != null) {
bone.skeleton.getAttachment(data.index, it)
} else null
}
sequenceIndex = -1
}
}