Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public void SpritePoolUse(String filePath, double startTime, double endTime, int particleCount, Color4 color)
- {
- using (OsbSpritePool spritePool = new OsbSpritePool(GetLayer("Particles"), filePath, OsbOrigin.Centre))
- {
- for (int v = 0; v < particleCount; v++)
- {
- float spawnX = Random(-107, 747);
- float spawnY = Random(0, 480);
- float distanceX = Random(-500, 500);
- float distanceY = Random(-500, 500);
- float randScale = Random(0.1f, 0.2f);
- var glow = spritePool.Get(startTime, endTime);
- glow.Additive(startTime, endTime);
- glow.Color(startTime, color);
- glow.Scale(startTime, randScale);
- glow.Move(startTime, endTime, new Vector2(spawnX, spawnY), new Vector2(spawnX + distanceX, spawnY + distanceY));
- glow.Fade(startTime, 0.1);
- glow.Fade(endTime, 0);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement