예제 #1
0
파일: ToolIcon.cs 프로젝트: hortont424/sand
        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;
        }