diff --git a/src/hollywoo_flixel/FlxDirector.kiss b/src/hollywoo_flixel/FlxDirector.kiss index 77a4a4d..9d890cc 100644 --- a/src/hollywoo_flixel/FlxDirector.kiss +++ b/src/hollywoo_flixel/FlxDirector.kiss @@ -251,16 +251,24 @@ (/ character.actor.width 2))) (set character.actor.y character.stagePosition.y) // Bump sprites up from the bottom if they're too tall - (let [bottom (+ character.actor.y character.actor.height)] - (when (> bottom FlxG.height) - (-= character.actor.y (- bottom FlxG.height)))) - // Display with y adjusted by z: - (-= character.actor.y character.stagePosition.z) - (FlxG.state.add character.actor) + (cond + ((flxMovie.presetPositions.exists (character.stagePosition.stringify)) + (let [bottom (+ character.actor.y character.actor.height)] + (when (> bottom FlxG.height) + (-= character.actor.y (- bottom FlxG.height)))) + // Display with y adjusted by z: + (-= character.actor.y character.stagePosition.z) + (let [layer (- LAYER_MAX (% character.stagePosition.z flxMovie.STAGE_BEHIND_DY))] + (.add (nth spriteLayers layer) character.actor))) + (true + (.add (nth spriteLayers (Std.int character.stagePosition.z)) character.actor))) + (cc)) (method :Void hideCharacter [:Character character :FlxCamera camera :Continuation cc] (FlxG.state.remove character.actor) + (doFor layer spriteLayers + (layer.remove character.actor)) (cc)) (prop &mut :Null nextCC)