forked from Yonokid/PyTaikoGreen
Compare commits
2
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
882628d561 | ||
|
|
7549216be1 |
No files matched your search
@@ -1,9 +1,9 @@
|
||||
{
|
||||
"background": {},
|
||||
"overlay": {
|
||||
"x": 100
|
||||
"x": 207
|
||||
},
|
||||
"footer": {
|
||||
"y": 105
|
||||
"y": 110
|
||||
}
|
||||
}
|
||||
@@ -27,46 +27,41 @@ function TutorialDonBG:update(current_time_ms)
|
||||
self.overlay_move:update(current_time_ms)
|
||||
end
|
||||
|
||||
-- One Fuji (background frame 1), one cloud (overlay) and one set of dots (background frame 2) per
|
||||
-- pattern tile, all scrolling with the pattern: the Fuji's foot behind the fans, the dots around
|
||||
-- the clouds (they bob with them). The cloud's place in the tile is overlay's x in texture.json.
|
||||
local FUJI_X, FUJI_Y = 39, 91
|
||||
local CLOUD_Y = 32
|
||||
local DOTS_X, DOTS_Y = 32, CLOUD_Y + 13
|
||||
-- The fans repeat every 80 px: their strips are tiled (and scroll a whole tile per loop) every
|
||||
-- 560 px, a multiple of that, so the copies line up.
|
||||
local FAN_TILE = 560
|
||||
local FLOOR_DY = 34
|
||||
|
||||
function TutorialDonBG:draw_textures(fade, y, frame)
|
||||
y = y + 40
|
||||
local tile = self.bg_texture.width
|
||||
local bob = self.overlay_move.attribute
|
||||
for i = 0, 4 do
|
||||
tex.draw_texture(self._id_bg, {
|
||||
frame = 0,
|
||||
fade = fade,
|
||||
x = (i * self.bg_texture.width) + self.move.attribute,
|
||||
y = y
|
||||
})
|
||||
tex.draw_texture(self._id_bg, {
|
||||
frame = 1,
|
||||
fade = fade,
|
||||
x = (i * self.bg_texture.width) + self.move.attribute,
|
||||
x = (i * tile) + self.move.attribute,
|
||||
y = y
|
||||
})
|
||||
end
|
||||
for i = 0, 5 do
|
||||
tex.draw_texture(self._id_overlay, {
|
||||
frame = frame,
|
||||
fade = fade,
|
||||
x = (i * self.overlay_texture.width) +
|
||||
self.move.attribute * (self.overlay_texture.width / self.bg_texture.width),
|
||||
y = y + self.overlay_move.attribute
|
||||
})
|
||||
for i = 0, 3 do
|
||||
local x = (i * tile) + self.move.attribute
|
||||
tex.draw_texture(self._id_bg, { frame = 1, fade = fade, x = x + FUJI_X, y = y + FUJI_Y })
|
||||
tex.draw_texture(self._id_overlay, { frame = frame, fade = fade, x = x, y = y + CLOUD_Y + bob })
|
||||
tex.draw_texture(self._id_bg, { frame = 2, fade = fade, x = x + DOTS_X, y = y + DOTS_Y + bob })
|
||||
end
|
||||
local fan_x = self.move.attribute * (FAN_TILE / tile)
|
||||
for i = 0, 4 do
|
||||
tex.draw_texture(self._id_footer, {
|
||||
frame = 0,
|
||||
fade = fade,
|
||||
x = (i * self.footer_texture.width) +
|
||||
self.move.attribute * (self.footer_texture.width / self.bg_texture.width),
|
||||
y = y + self.overlay_move.attribute
|
||||
})
|
||||
tex.draw_texture(self._id_footer, {
|
||||
frame = 1,
|
||||
fade = fade,
|
||||
x = (i * (self.footer_texture.width - 80)) +
|
||||
self.move.attribute * (self.footer_texture.width / self.bg_texture.width),
|
||||
y = (y + 30) + self.overlay_move.attribute
|
||||
})
|
||||
tex.draw_texture(self._id_footer, { frame = 0, fade = fade, x = (i * FAN_TILE) + fan_x, y = y + bob })
|
||||
tex.draw_texture(self._id_footer, { frame = 1, fade = fade, x = (i * FAN_TILE) + fan_x, y = (y + 30) + bob })
|
||||
-- a third row so the fans reach down to the lane
|
||||
tex.draw_texture(self._id_footer, { frame = 1, fade = fade, x = (i * FAN_TILE) + fan_x, y = (y + 60) + bob })
|
||||
end
|
||||
end
|
||||
|
||||
@@ -79,6 +74,7 @@ function TutorialBackground.new(player_num, bpm)
|
||||
tex.load_folder(COLLAB_PATH, "bg_normal/bg_0")
|
||||
self.donbg = TutorialDonBG.new(1, player_num, COLLAB_PATH)
|
||||
self._id_bg_0 = tex.get_texture(COLLAB_PATH .. "/" .. "bg_0" .. "/" .. "background") or 0
|
||||
self.floor_texture = tex.get_texture_info("bg_0", "background")
|
||||
|
||||
return self
|
||||
end
|
||||
@@ -101,7 +97,12 @@ function TutorialBackground:handle_gauge(player_num, progress, is_clear, is_rain
|
||||
|
||||
function TutorialBackground:draw_back()
|
||||
self.donbg:draw()
|
||||
tex.draw_texture(self._id_bg_0)
|
||||
-- the floor sits FLOOR_DY lower than texture.json says, so the drums clear the lane; the rows that
|
||||
-- would then run into the bottom band are cut off
|
||||
tex.draw_texture(self._id_bg_0, {
|
||||
y = FLOOR_DY, y2 = -FLOOR_DY,
|
||||
src = { x = 0, y = 0, width = self.floor_texture.width, height = self.floor_texture.height - FLOOR_DY },
|
||||
})
|
||||
end
|
||||
|
||||
function TutorialBackground:draw_fore() end
|
||||
|
||||
@@ -166,8 +166,7 @@ function Nameplate:draw(x, y, fade)
|
||||
if self.now and self.shiny then self:draw_sparkles(x, y, fade) end
|
||||
|
||||
local dan_offset = 0
|
||||
-- a plate without a player badge (the entry screen) shows no dan
|
||||
if self.dan ~= -1 and self.pnum_tex then
|
||||
if self.dan ~= -1 then
|
||||
tex.draw_texture(self.dan_emblem_bg, { x = x, y = y, fade = fade })
|
||||
if self.is_gold then
|
||||
tex.draw_texture(self.dan_emblem_gold, { frame = self.dan, x = x, y = y, fade = fade })
|
||||
@@ -188,13 +187,9 @@ function Nameplate:draw(x, y, fade)
|
||||
local frame_top_h = self.frame_top_info.height
|
||||
local outline_h = self.outline_info.height
|
||||
|
||||
-- the name is centred right of the badge, or right of the dan chip (drawn at its texture.json x,
|
||||
-- so where it ends doesn't depend on the badge)
|
||||
local left = offset
|
||||
if dan_offset > 0 then left = math.max(offset, self.emblem_info.x[1] + dan_offset) end
|
||||
local name_max = frame_top_w - self.padding - left
|
||||
local name_max = frame_top_w - self.padding - offset - dan_offset
|
||||
local name_width = math.min(self.name_text.width, name_max)
|
||||
local name_x = x + left + (outline_w - left) / 2.0 - name_width / 2
|
||||
local name_x = x + offset + dan_offset + (outline_w - offset - dan_offset) / 2.0 - name_width / 2
|
||||
local name_y = y + outline_h / 2.0 + self.name_offset
|
||||
self.name_text:draw({ x = name_x, y = name_y, x2 = name_width - self.name_text.width, fade = fade })
|
||||
|
||||
|
||||
Reference in new issue
Block a user