public SpriteExplosion(Texture2D explosion, Vector2 position, SpriteStripMetadata metadata) : base(explosion, position) { animation = new SpriteStrip(); animation.Initialize(explosion, position, metadata); }
public override void LoadContent() { #if !MONOMAC notificationAnimationMetadata = new SpriteStripMetadata("./Resources/Animations/HDDACCESSINDICATOR.ini"); #else notificationAnimationMetadata = new SpriteStripMetadata("./Content/Animations/HDDACCESSINDICATOR.ini"); #endif Vector2 centerOfScreen = new Vector2(ScreenManager.GraphicsDevice.Viewport.TitleSafeArea.Center.X, ScreenManager.GraphicsDevice.Viewport.TitleSafeArea.Center.Y); ContentManager content = ScreenManager.Game.Content; notificationAnimationTexture = content.Load<Texture2D>("./Animations/HDDACCESSINDICATOR"); notificationAnimation = new SpriteStrip(); notificationAnimation.Initialize(notificationAnimationTexture, centerOfScreen, notificationAnimationMetadata); //notificationAnimation.Initialize(notificationAnimationTexture, centerOfScreen, 128, 128, 30, 30, Color.White, 1.0f, true); notificationFont = content.Load<SpriteFont>("./Fonts/ConsoleFont"); }
public void Initialize(Texture2D texture, Vector2 position, SpriteStripMetadata metadata) { this.spriteStrip = texture; this.scale = metadata.Scale; this.frameCount = metadata.FrameCount; this.frameTime = metadata.FrameSpeed; this.FrameWidth = metadata.FrameWidth; this.FrameHeight = metadata.FrameHeight; this.Looping = metadata.Loop; this.color = metadata.TintColor; this.Position = position; this.elapsedTime = 0; this.currentFrame = metadata.StartingFrame; this.Active = true; }