Esempio n. 1
0
        public virtual void Draw(SpriteBatch spriteBatch)
        {
            var position = ManagerCamera.WorlToScreenPosition(Position);

            if (ManagerCamera.InScreenCheck(Position))
            {
                var tileFrame = TileFrames[_animationIndex];
                spriteBatch.Draw(_texture, new Rectangle((int)position.X, (int)position.Y, Width, Height),
                                 new Rectangle(tileFrame.TextureXPos * (Width + 1) + 1, tileFrame.TextureYPos * (Height + 1) + 1, Width, Height), Color.White);
            }
        }
Esempio n. 2
0
 public bool GetPosition(Vector2 position, out Vector2 newPosition)
 {
     newPosition = _managerCamera.WorlToScreenPosition(position);
     return(_managerCamera.InScreenCheck(position));
 }