/// <summary> /// Creates a hitbox visualizer for the specified object. /// </summary> /// <param name="obj">The object to render a rectangular hitbox around.</param> /// <param name="batch">The <see cref="Microsoft.Xna.Framework.Graphics.SpriteBatch"/> to render the hitbox to.</param> /// <param name="outline">The outline color to use.</param> public HitboxVisualizer(ISizedScreenObject obj, SpriteBatch batch, Color outline) { if (obj == null) { throw new ArgumentNullException("obj"); } if (batch == null) { throw new ArgumentNullException("batch"); } _outlineColor = outline; _object = obj; _isVisible = true; Outlines = new Dictionary <Point, Texture2D>(); _spriteBatch = batch; _textureCreator = new TextureFactory(batch.GraphicsDevice); }
/// <summary> /// Creates a hitbox visualizer for the specified object, with a navy colored outline. /// </summary> /// <param name="obj">The object to render a rectangular hitbox around.</param> /// <param name="batch">The <see cref="Microsoft.Xna.Framework.Graphics.SpriteBatch"/> to render the hitbox to.</param> public HitboxVisualizer(ISizedScreenObject obj, SpriteBatch batch) : this(obj, batch, Color.Navy) { }