示例#1
0
        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;
        }
示例#2
0
        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;
        }