diff --git a/Graphics/background/collab/tutorial/donbg/0_1/texture.json b/Graphics/background/collab/tutorial/donbg/0_1/texture.json index a27d37c2..20fff9a4 100644 --- a/Graphics/background/collab/tutorial/donbg/0_1/texture.json +++ b/Graphics/background/collab/tutorial/donbg/0_1/texture.json @@ -1,9 +1,9 @@ { "background": {}, "overlay": { - "x": 100 + "x": 207 }, "footer": { - "y": 105 + "y": 110 } } diff --git a/Scripts/background/bg_collabs/tutorial.lua b/Scripts/background/bg_collabs/tutorial.lua index 1725588d..46ed2e4a 100644 --- a/Scripts/background/bg_collabs/tutorial.lua +++ b/Scripts/background/bg_collabs/tutorial.lua @@ -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