public void AnchorDrawing(DebugObject obj) { SpriteBatch.Draw( texture: TextureLoader.TheOnePixel, destinationRectangle: new Rectangle((int)obj.Position.X, (int)obj.Position.Y, (int)TextureLoader.Font.MeasureString(obj.ToString()).X, (int)TextureLoader.Font.MeasureString(obj.ToString()).Y), color: Color.Black * 0.4f); SpriteBatch.DrawString(TextureLoader.Font, obj.ToString(), obj.Position, Color.White); SpriteBatch.DrawString(TextureLoader.Font, "Anchored", obj.item.Position, Color.Crimson); SpriteBatch.Draw( texture: TextureLoader.TheOnePixel, destinationRectangle: new Rectangle((int)obj.item.Position.X, (int)obj.item.Position.Y, obj.item.TextureWidth, obj.item.TextureHeight), color: Color.Black * 0.4f); SpriteBatch.Draw( texture: TextureLoader.TheOnePixel, destinationRectangle: new Rectangle((int)obj.item.BoundingBoxX, (int)obj.item.BoundingBoxY, obj.item.BoundingBox.Width, obj.item.BoundingBox.Height), color: Color.Black * 0.4f); }
public void DisplayObjectProps(IGameObject obj) { var toDraw = new DebugObject(obj); toDraw.Position = new Vector2(0, 0); SpriteBatch.Draw( texture: TextureLoader.TheOnePixel, destinationRectangle: new Rectangle((int)toDraw.Position.X, (int)toDraw.Position.Y, (int)TextureLoader.Font.MeasureString(toDraw.ToString()).X, (int)TextureLoader.Font.MeasureString(toDraw.ToString()).Y), color: Color.Black * 0.4f); SpriteBatch.DrawString(TextureLoader.Font, toDraw.ToString(), toDraw.Position, Color.White); }
public void DisplayObjectProps(IGameObject obj) { var toDraw = new DebugObject(obj); toDraw.Position = new Vector2(0,0); SpriteBatch.Draw( texture: TextureLoader.TheOnePixel, destinationRectangle: new Rectangle((int)toDraw.Position.X, (int)toDraw.Position.Y, (int)TextureLoader.Font.MeasureString(toDraw.ToString()).X, (int)TextureLoader.Font.MeasureString(toDraw.ToString()).Y), color: Color.Black * 0.4f); SpriteBatch.DrawString(TextureLoader.Font, toDraw.ToString(), toDraw.Position, Color.White); }