Update transition.lua #1
@@ -712,7 +712,23 @@ function SongTransition.new(title, subtitle, is_second)
|
||||
return self
|
||||
end
|
||||
|
||||
-- timeline the engine reads (rainbow rise for the dan art, done); wall clock, not the movie's
|
||||
local RISE_MS, RISE_DIST = 266.0, 612
|
||||
local SCENE1_MS, SCENE2_MS = 532.0, 133.0
|
||||
function SongTransition:state()
|
||||
local t = self.rt or 0
|
||||
local rise = RISE_DIST * math.max(0, math.min(1, t / RISE_MS)) ^ 3
|
||||
if self.is_second then
|
||||
return { rainbow_up = rise, fade_out = math.max(0, 1 - t / SCENE2_MS), finished = t >= SCENE2_MS }
|
||||
end
|
||||
return { rainbow_up = rise, fade = math.min(1, t / SCENE1_MS), finished = t >= SCENE1_MS }
|
||||
end
|
||||
|
||||
function SongTransition:start() self.rt0 = nil end
|
||||
|
||||
function SongTransition:update(current_ms, rainbow_up, info_fade)
|
||||
if not self.rt0 then self.rt0 = current_ms end
|
||||
self.rt = current_ms - self.rt0
|
||||
if self.last_ms then
|
||||
self.t = self.t + math.max(0, math.min(MAX_DT, current_ms - self.last_ms))
|
||||
end
|
||||
|
||||
Reference in new issue
Block a user