public ToolIcon(Game game, Tool tool) : base(game) { DrawOrder = 100; _tool = tool; _drainValue = 0.0f; _bitmap = new Bitmap(128 + 20 + 6, 128 + 20 + 6); _graphics = Graphics.FromImage(_bitmap); _graphics.SmoothingMode = SmoothingMode.HighQuality; _graphics.PixelOffsetMode = PixelOffsetMode.HighQuality; _drainTexture = null; _bitmapBytes = null; Scale = 1.0f; }
private ToolIcon AddToolIconForTool(Tool tool, float x, float y) { if(tool == null) { return null; } var icon = new ToolIcon(Game, tool) { X = x, Y = y }; Game.Components.Add(icon); return icon; }