forked from Yonokid/PyTaikoGreen
35 lines
1.6 KiB
Lua
35 lines
1.6 KiB
Lua
SongTransition = {}
|
|
SongTransition.__index = SongTransition
|
|
|
|
function SongTransition.new(title, subtitle, is_second)
|
|
local self = setmetatable({}, SongTransition)
|
|
self.is_second = is_second and true or false
|
|
|
|
self.t_rainbow_bg_bottom = tex.get_texture("global/rainbow_transition/rainbow_bg_bottom")
|
|
self.t_rainbow_bg_top = tex.get_texture("global/rainbow_transition/rainbow_bg_top")
|
|
self.t_rainbow_bg = tex.get_texture("global/rainbow_transition/rainbow_bg")
|
|
self.t_chara_left = tex.get_texture("global/rainbow_transition/chara_left")
|
|
self.t_chara_right = tex.get_texture("global/rainbow_transition/chara_right")
|
|
self.t_chara_center = tex.get_texture("global/rainbow_transition/chara_center")
|
|
|
|
return self
|
|
end
|
|
|
|
function SongTransition:draw_bg(total_offset, rainbow_up, mini_up, chara_down)
|
|
tex.draw_texture(self.t_rainbow_bg_bottom, { y = -rainbow_up - total_offset })
|
|
tex.draw_texture(self.t_rainbow_bg_top, { y = -rainbow_up - total_offset })
|
|
tex.draw_texture(self.t_rainbow_bg, { y = -rainbow_up - total_offset })
|
|
|
|
local offset = chara_down
|
|
local chara_offset = 0
|
|
if self.is_second then
|
|
offset = chara_down - mini_up / 3
|
|
local cfg = tex.get_skin_config("transition_chara_offset")
|
|
chara_offset = (cfg and cfg.y) or 0
|
|
end
|
|
|
|
tex.draw_texture(self.t_chara_left, { x = -mini_up / 2 - chara_offset, y = -mini_up + offset - total_offset })
|
|
tex.draw_texture(self.t_chara_right, { x = mini_up / 2 + chara_offset, y = -mini_up + offset - total_offset })
|
|
tex.draw_texture(self.t_chara_center, { y = -rainbow_up + offset - total_offset })
|
|
end
|