make prop LAYER_MAX be above all layers

This commit is contained in:
2022-01-09 21:51:29 -07:00
parent a8b6bb50c3
commit 62392bf1df
2 changed files with 6 additions and 3 deletions

View File

@@ -295,7 +295,7 @@
(let [propBottom (+ prop.y prop.height)]
(when (> propBottom DIALOG_Y)
(-= prop.y (- propBottom DIALOG_Y)))))
(.add (nth currentState.spriteLayers SceneFlxState.LAYER_MAX) prop)))
(currentState.add prop)))
(cc))
(method :Void smartShowPropOnScreen [:FlxSprite prop :Int layer :RelativePosition rpos :Continuation cc]
@@ -306,7 +306,10 @@
(SpriteTools.scaleStampOn prop canvas rpos)
(set prop.x x)
(set prop.y y)
(.add (nth currentState.spriteLayers layer) prop)))
(if (= layer SceneFlxState.LAYER_MAX)
// In front of everything:
~(currentState.add prop)
(.add (nth currentState.spriteLayers layer) prop))))
(cc))
(method :Void showPropOnScreen [:FlxSprite prop :FlxScreenPosition position :Continuation cc]

View File

@@ -17,7 +17,7 @@
(super)
(add setSprite)
// TODO characters will be in front of every prop layer -- characters need their own group layer
(doFor i (range (+ 1 LAYER_MAX))
(doFor i (range LAYER_MAX)
(let [g (new FlxTypedGroup<FlxSprite>)]
(spriteLayers.push g)
(add g))))