indexing description: "[ An EM_NEVER_ENDING_BACKGROUND_VERTICAL is an EM_NEVER_ENDING_BACKGROUND constraint to vertical movement. ]" date: "$Date$" revision: "$Revision$" class EM_NEVER_ENDING_BACKGROUND_VERTICAL inherit EM_NEVER_ENDING_BACKGROUND create make feature {NONE} -- Initialization make (back_ground: EM_DRAWABLE) is -- Creates an EM_NEVER_ENDING_BACKGROUND_VERTICAL from `back_ground'. require back_ground /= void do img := back_ground speed := 0 cur_position := 0 create tile_pattern.make (back_ground, speed.Max_value // back_ground.height) last_time_pos_changed := time.ticks set_visible (True) ensure speed = 0 end feature -- Commands go_to_time (cur_time: INTEGER) is -- Update `cur_position' up to `cur_time'. do -- Update `cur_position'. update_cur_position (img.height, cur_time) end draw (a_surface: EM_SURFACE) is -- Draws `current' to `a_surface' local pos_y, clip_y: INTEGER do if is_visible then -- Calculate where to draw 'Current'. clip_y := a_surface.coordinate_area.upper_bound.floor pos_y := clip_y - pos_to_image_size (clip_y - (y - cur_position), img.height) -- Set up and draw tile pattern filling out `a_surface'. tile_pattern.set_times ((a_surface.coordinate_area.lower_bound.ceiling - pos_y) // img.height + 1) tile_pattern.set_x_y (x, pos_y) tile_pattern.draw (a_surface) end end feature -- Status setting height: INTEGER is -- The height of `current' do result := result.Max_value end width: INTEGER is -- The width of `current' do result := tile_pattern.width end feature {NONE} -- Implementation tile_pattern: EM_TILE_PATTERN_VERTICAL end