actorFlxSprite portraitFacingForward mode

This commit is contained in:
2023-05-16 11:21:39 -06:00
parent 1d9ad78eb2
commit f04bd90c30
2 changed files with 5 additions and 0 deletions

View File

@@ -6,6 +6,8 @@
(prop :Float z 0)
(prop &mut :Bool portraitFacingForward false)
(defNew [&prop :String assetPath &opt frameWidth frameHeight :StageFacing defaultFacing :Map<String,AnimationArgs> animations]
(super)

View File

@@ -239,6 +239,9 @@
// TODO also allow for manually defined flipped frames so text on clothing doesn't mirror
(set character.actor.cameras [camera])
(set character.actor.flipX ?!(= character.stageFacing character.actor.defaultFacing))
// For characters whose images are forward-facing portraits, it's wrong to flip them based on facing:
(when character.actor.portraitFacingForward
(set character.actor.flipX false))
// All actors same width, display centered on x
(character.actor.setGraphicSize flxMovie.ACTOR_WIDTH)
(character.actor.updateHitbox)