示例#1
0
        public FogSystemManager(MCamera pCam, GameObject pTarget) : base(false)
        {
            _lightAlpha  = new Bitmap("data/player_light_grid_map.png");
            _lightSprite = new Sprite("data/player_light_grid_map.png", false, false);

            _brushes = new Brush[4];
            SetBrushes(HatchStyle.Cross);

            _bg = new EasyDraw(game.width, game.height);
            pCam.AddChild(_bg);
            _bg.SetOriginToCenter();
            _bg.Clear(Color.FromArgb(100, Color.Black));

            _cam        = pCam;
            _mainTarget = pTarget;

            string[] hatchesStrs = new string[51];
            for (int i = 0; i < 51; i++)
            {
                var hatchStyle = (HatchStyle)i;
                hatchesStrs[i] = hatchStyle.ToString();
            }

            hatchesStrs = hatchesStrs.OrderBy(h => h).ToArray();

            _hatchStyles = new HatchStyle[51];
            for (int i = 0; i < _hatchStyles.Length; i++)
            {
                var hatchStyle = Enum.Parse(typeof(HatchStyle), hatchesStrs[i]);
                _hatchStyles[i] = (HatchStyle)hatchStyle;
            }

            Console.WriteLine($"{this}: {string.Join("\r\n", _hatchStyles)}");
        }
        public GameHud(BaseLevel pLevel, MCamera pCam) : base(false)
        {
            Instance = this;

            _hudRatioX = (float)game.width / Settings.ScreenResolutionX;
            _hudRatioY = (float)game.height / Settings.ScreenResolutionY;

            _level = pLevel;
            _cam   = pCam;
            Cam    = _cam;

            _cam.AddChild(this);
            SetXY(-_cam.Width / 2f, -_cam.Height / 2f);

            _flashbackCounterHudPanel = new FlashbackCounterHudPanel();
            AddChild(_flashbackCounterHudPanel);
            _flashbackCounterHudPanel.SetXY(70, 36);

            _memoriesHudPanel = new MemoriesHudPanel();
            _memoriesHudPanel.SetXY(70, 36);

            _resetFlashbackButton = new ResetFlashbackDetectiveButtonHud();
            _resetFlashbackButton.SetOriginToCenter();
            AddChild(_resetFlashbackButton);
            _resetFlashbackButton.SetXY(game.width - 166, 60);
            _resetFlashbackButton.SetActive(false);

            CoroutineManager.StartCoroutine(Start(), this);
        }