Skip to main content

apply_hold

Function apply_hold 

Source
pub fn apply_hold<T: Clone>(frames: &[T], frame: usize, count: usize) -> Vec<T>
Expand description

Apply hold transform: duplicate a specific frame multiple times.

Given frames [A, B, C] with frame=1 and count=3, produces [A, B, B, B, C].

§Arguments

  • frames - The animation frames (sprite names)
  • frame - Index of the frame to hold (0-based)
  • count - Number of times to repeat the frame (total occurrences)

§Returns

A new Vec with the held frame duplicated, or original if frame index is invalid