Advertisement
Jiysea

Wave Effect

Jul 9th, 2022 (edited)
827
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.56 KB | None | 0 0
  1. WaveEffect("sb/pixel.png", "Foreground", 51606, 55651, new Vector2(0, 240), 100, 500, new Vector2(20, 20), 0.5);
  2.  
  3. public void WaveEffect(String filepath, String layer, double startTime, double endTime, Vector2 startPos, double height, double duration, Vector2 scaleVec, double fadeOpac)
  4.         {
  5.             double posX = startPos.X;
  6.             double posY = startPos.Y;
  7.             double width = height * 2;
  8.  
  9.             var p = GetLayer(layer).CreateSprite(filepath);
  10.             p.Fade(startTime, fadeOpac);
  11.             p.ScaleVec(startTime, scaleVec);
  12.  
  13.             for (double time = startTime; time < endTime; time += duration)
  14.             {
  15.                 p.MoveX(OsbEasing.None, time, time + duration / 2, posX, posX + width / 2);
  16.                 p.MoveX(OsbEasing.None, time + duration / 2, time + duration, posX + width / 2, posX + width);
  17.  
  18.                 p.MoveY(OsbEasing.InOutSine, time, time + duration * 0.50, posY + height / 2, posY - height / 2);
  19.                 p.MoveY(OsbEasing.InOutSine, time + duration * 0.50, time + duration, posY - height / 2, posY + height / 2);
  20.  
  21.                 // p.MoveY(OsbEasing.In, time, time + duration * 0.25, posY + height / 2, posY);
  22.                 // p.MoveY(OsbEasing.Out, time + duration * 0.25, time + duration * 0.50, posY, posY - height / 2);
  23.                 // p.MoveY(OsbEasing.In, time + duration * 0.50, time + duration * 0.75, posY - height / 2, posY);
  24.                 // p.MoveY(OsbEasing.Out, time + duration * 0.75, time + duration, posY, posY + height / 2);
  25.  
  26.                 posX += width;
  27.             }
  28.         }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement