Beispiel #1
0
        void Update()
        {
            //_bg.graphics.CompositingMode = CompositingMode.SourceOver;
            _bg.Clear(Color.FromArgb(255, Color.Black));

            var localPos = _bg.InverseTransformPoint(_mainTarget.x, _mainTarget.y);

            float localX = localPos.x + MyGame.HALF_SCREEN_WIDTH;
            float localY = localPos.y + MyGame.HALF_SCREEN_HEIGHT;

            _bg.graphics.CompositingMode = CompositingMode.SourceCopy;
            _lightSprite.SetXY(localX, localY);
            _bg.DrawSprite(_lightSprite);

            DrawLight(Input.mouseX, Input.mouseY);
            //DrawLight(localX, localY);

            localPos = _bg.InverseTransformPoint(2792, 3995);
            DrawLight(localPos.x + MyGame.HALF_SCREEN_WIDTH, localPos.y + MyGame.HALF_SCREEN_HEIGHT);

            //_bg.graphics.DrawImage(_lightAlpha, Input.mouseX, Input.mouseY);

            if (Input.GetKeyDown(Key.V))
            {
                hatchIndex = GeneralTools.GetCircularArrayIndex(hatchIndex - 1, _hatchStyles.Length);
                SetBrushes(_hatchStyles[hatchIndex]);
                Console.WriteLine(_hatchStyles[hatchIndex]);
            }
            else if (Input.GetKeyDown(Key.B))
            {
                hatchIndex = GeneralTools.GetCircularArrayIndex(hatchIndex + 1, _hatchStyles.Length);
                SetBrushes(_hatchStyles[hatchIndex]);
                Console.WriteLine(_hatchStyles[hatchIndex]);
            }
        }