themedRollCredits support

This commit is contained in:
2023-07-03 07:11:50 -06:00
parent 6aca7062d2
commit 6a604fed7f

View File

@@ -727,13 +727,25 @@
(+= textY threeColSize creditMargin)) (+= textY threeColSize creditMargin))
(otherwise))) (otherwise)))
(doFor text creditsText (let [pixelsToScroll
(FlxG.state.add text) (+ textY .height (last creditsText))
(set text.cameras [flxMovie.uiCamera]) idealTimeLimit
(let [:Array<Dynamic> tweenArgs []] (/ pixelsToScroll IDEAL_SCROLL_SPEED)
(tweenArgs.push text) timeLimitDifference (- idealTimeLimit timeLimit)
(tweenArgs.push text.x) scrollSpeed
(tweenArgs.push (- text.y textY)) (if timeLimit
(tweenArgs.push 200) (/ pixelsToScroll timeLimit)
(tweenArgs.push cc) IDEAL_SCROLL_SPEED)]
(Reflect.callMethod flxMovie (Reflect.field flxMovie "linearMotion") tweenArgs)))) (#when debug
(when !(= scrollSpeed IDEAL_SCROLL_SPEED)
(print "Time given for credit roll (${timeLimit}s) is $(Math.abs timeLimitDifference)sec $(if (> timeLimitDifference 0) "too short" "too long") for ideal speed.")))
(doFor text creditsText
(FlxG.state.add text)
(set text.cameras [flxMovie.uiCamera])
(let [:Array<Dynamic> tweenArgs []]
(tweenArgs.push text)
(tweenArgs.push text.x)
(tweenArgs.push (- text.y textY))
(tweenArgs.push scrollSpeed)
(tweenArgs.push cc)
(Reflect.callMethod flxMovie (Reflect.field flxMovie "linearMotion") tweenArgs)))))