如何镜像龙骨动画?
How to mirror dragonbones animation?
我用龙骨动画制作KorGE游戏。如何镜像这个龙骨动画?我想让角色向右看而不是向左看:)
val factory = KorgeDbFactory()
val skeDeferred = asyncImmediately { Json.parse(resourcesVfs["Ubbie/Ubbie_ske.json"].readString())!! }
val texDeferred = asyncImmediately { resourcesVfs["Ubbie/Ubbie_tex.json"].readString() }
val imgDeferred = asyncImmediately { resourcesVfs["Ubbie/Ubbie_tex.png"].readBitmap().mipmaps() }
factory.parseDragonBonesData(skeDeferred.await())
factory.parseTextureAtlasData(Json.parse(texDeferred.await())!!, imgDeferred.await())
val armatureDisplay = factory.buildArmatureDisplay("ubbie")!!.position(600, 720).scale(1)
armatureDisplay.animation.play("walk")
addUpdater {
this += armatureDisplay
}
SCALE_X = -1 给出镜像效果
val SCALE_X=-1
val SCALE_Y=1
...
val armatureDisplay = factory.buildArmatureDisplay("ubbie")!!.position(600, 720).scale(SCALE_X, SCALE_Y)
我用龙骨动画制作KorGE游戏。如何镜像这个龙骨动画?我想让角色向右看而不是向左看:)
val factory = KorgeDbFactory()
val skeDeferred = asyncImmediately { Json.parse(resourcesVfs["Ubbie/Ubbie_ske.json"].readString())!! }
val texDeferred = asyncImmediately { resourcesVfs["Ubbie/Ubbie_tex.json"].readString() }
val imgDeferred = asyncImmediately { resourcesVfs["Ubbie/Ubbie_tex.png"].readBitmap().mipmaps() }
factory.parseDragonBonesData(skeDeferred.await())
factory.parseTextureAtlasData(Json.parse(texDeferred.await())!!, imgDeferred.await())
val armatureDisplay = factory.buildArmatureDisplay("ubbie")!!.position(600, 720).scale(1)
armatureDisplay.animation.play("walk")
addUpdater {
this += armatureDisplay
}
SCALE_X = -1 给出镜像效果
val SCALE_X=-1
val SCALE_Y=1
...
val armatureDisplay = factory.buildArmatureDisplay("ubbie")!!.position(600, 720).scale(SCALE_X, SCALE_Y)