All Downloads are FREE. Search and download functionalities are using the official Maven repository.

commonMain.ru.casperix.spine.Slot.kt Maven / Gradle / Ivy

The newest version!
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
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy