问题描述
我用龙骨动画制作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)