private bool animating = true; //Turns the animating on and off #endregion Fields #region Constructors public AnimatedComponent(Rectangle myPosition, Texture2DFramed myTex) : base(myPosition,myTex) { //Setting how fast it animates if (myTex.animationSpeed != 0) { maxAnimationTimer = myTex.animationSpeed;//If you passed in a value } }
public SpriteSheetComponent(Rectangle myPosition, Texture2DFramed myTex) { this.Position = myPosition; this.Texture = myTex.texture; FrameHeight = myTex.frameHeight; FrameWidth = myTex.frameWidth; numberFrames = myTex.numberFrames; source = new Rectangle((int)currentFrame.X * FrameWidth, (int)currentFrame.Y * FrameHeight, FrameWidth, FrameHeight); }
protected override void LoadContent() { spriteBatch = new SpriteBatch(GraphicsDevice); menuFont = Content.Load<SpriteFont>("Graphics/Fonts/menuFont"); sceneryOptions.Add(Content.Load<Texture2D>("Graphics/Scenery/hill")); sceneryOptions.Add(Content.Load<Texture2D>("Graphics/Scenery/graveyardhill")); sceneryOptions.Add(Content.Load<Texture2D>("Graphics/Scenery/moon")); sceneryOptions.Add(Content.Load<Texture2D>("Graphics/Scenery/tree")); tileButtonTexture = Content.Load<Texture2D>("Graphics/GUI/tileIcon"); sceneryButtonTexture = Content.Load<Texture2D>("Graphics/GUI/sceneryIcon"); objectiveButtonTexture = Content.Load<Texture2D>("Graphics/GUI/objectiveIcon"); radioButtonTexture = Content.Load<Texture2D>("Graphics/GUI/radioButton"); arrowTexture = Content.Load<Texture2D>("Graphics/GUI/uparrow"); tileSpriteSheet = new Texture2DFramed(Content.Load<Texture2D>("Graphics/Tiles/tilesSpriteSheet"), 50, 50); grassTexture = Content.Load<Texture2D>("Graphics/Tiles/grass"); glassTexture = Content.Load<Texture2D>("Graphics/Tiles/window"); wallpaperTexture = Content.Load<Texture2D>("Graphics/Tiles/innerBrickDark"); wallTexture = Content.Load<Texture2D>("Graphics/Tiles/innerBrick"); floorTexture = Content.Load<Texture2D>("Graphics/Tiles/wood"); }