internal EventSprite(string filename, Vector2 startPosition, OriginTypes origin, StoryLayer layer) { Texture2D texture = SpriteCache.GetTexture(BeatmapManager.Current.ContainingFolder + "\\" + filename); Sprite = new pSprite(texture, FieldTypes.GamefieldRatio, origin, ClockTypes.Audio, startPosition, EventManager.GetIncreasingDrawDepth(layer), false, Color.White); Layer = layer; Origin = origin; Type = EventTypes.Sprite; Filename = filename; }
internal EventAnimation(string filename, Vector2 startPosition, OriginTypes origin, StoryLayer layer, int frameCount, int frameDelay) { Texture2D[] textures = new Texture2D[frameCount]; for (int i = 0; i < frameCount; i++) { textures[i] = SpriteCache.GetTexture(BeatmapManager.Current.ContainingFolder + "\\" + filename.Replace(".", i + ".")); } Animation = new pAnimation(textures, FieldTypes.GamefieldRatio, origin, ClockTypes.Audio, startPosition, EventManager.GetIncreasingDrawDepth(layer), false, Color.White, null); Sprite = Animation; FrameDelay = Math.Max(1, frameDelay); Animation.frameSkip = (int)Math.Round(0.06 * frameDelay); Layer = layer; Origin = origin; Type = EventTypes.Animation; Filename = filename; }