示例#1
0
 private void DrawHexaIcon(SpriteBatch spriteBatch, Vector2 pos, HUDTexture passive, HUDTexture active)
 {
     DrawHexaIcon(spriteBatch, pos, GameResources.Inst().GetHudTexture(passive), GameResources.Inst().GetHudTexture(active));
 }
示例#2
0
 public Texture2D GetHudTexture(HUDTexture id)
 {
     return hud[(int) id];
 }
示例#3
0
 public FreshCoin(HUDTexture coinTex)
 {
     CoinTex = coinTex;
 }
示例#4
0
        public static void Init()
        {
            EntityModule.PostTick += Tick;
            Config.ConfigRefresh  += ConfigRefresh;

            menuELLogoTex = new HUDTexture(AssetLocator.HUDFragmentShader, AssetLocator.HudLayer, AssetLocator.MainWindow)
            {
                Anchoring                = ViewportAnchoring.TopRight,
                AnchorOffset             = new Vector2(EL_LOGO_TEX_TARGET_X, 0f),
                AspectCorrectionStrategy = HUDTexture.AspectRatioCorrectionStrategy.UseBestUniformScaling,
                Color    = new Vector4(1f, 1f, 1f, 0f),
                Rotation = 0f,
                Scale    = new Vector2(0.2f, 0.15f),
                Texture  = AssetLocator.ELLogo,
                ZIndex   = 9
            };

            menuIdentTex = new HUDTexture(AssetLocator.HUDFragmentShader, AssetLocator.HudLayer, AssetLocator.MainWindow)
            {
                Anchoring                = ViewportAnchoring.TopLeft,
                AnchorOffset             = new Vector2(EL_IDENT_TEX_TARGET_X, EL_IDENT_TEX_TARGET_X),
                AspectCorrectionStrategy = HUDTexture.AspectRatioCorrectionStrategy.UseBestUniformScaling,
                Color    = new Vector4(1f, 1f, 1f, 0f),
                Rotation = 0f,
                Scale    = new Vector2(0.07f, 0.05f),
                Texture  = AssetLocator.MainMenuPlayButton,
                ZIndex   = 9
            };

            menuIdentString = AssetLocator.TitleFont.AddString(
                AssetLocator.HudLayer,
                AssetLocator.MainWindow,
                ViewportAnchoring.TopLeft,
                new Vector2(0.06f, EL_IDENT_STRING_TARGET_Y),
                Vector2.ONE * 0.575f
                );
            menuIdentString.Text  = String.Empty;
            menuIdentString.Color = new Vector3(95f, 145f, 46f) / 255f;

            worldIconTex = new HUDTexture(AssetLocator.HUDFragmentShader, AssetLocator.HudLayer, AssetLocator.MainWindow)
            {
                Anchoring                = ViewportAnchoring.BottomLeft,
                AnchorOffset             = new Vector2(-0.015f, -0.015f),
                AspectCorrectionStrategy = HUDTexture.AspectRatioCorrectionStrategy.UseBestUniformScaling,
                Color    = new Vector4(1f, 1f, 1f, 0f),
                Rotation = 0f,
                Scale    = new Vector2(0.15f, 0.25f),
                Texture  = AssetLocator.WorldIcons[0],
                ZIndex   = 2
            };

            var version = Assembly.GetExecutingAssembly().GetName().Version;

            versionString = AssetLocator.MainFont.AddString(
                AssetLocator.HudLayer,
                AssetLocator.MainWindow,
                ViewportAnchoring.BottomLeft,
                new Vector2(0.005f, 0.005f),
                Vector2.ONE * 0.2f
                );
            versionString.Text  = "EL Build " + version.Build + "." + version.Revision;
            versionString.Color = new Vector4(1f, 1f, 1f, 0f);

            var hudIPB = AssetLocator.HudLayer.GetResource <InputBindingRegistry>();

            hudIPB.RegisterLeftStickEvent((x, y, _) => {
                lock (staticMutationLock) {
                    if (currentMenuState == MenuState.InGame)
                    {
                        return;
                    }
                    float threshold = Config.OptionSelectThreshold;

                    if (y <= -threshold)
                    {
                        if (!downLSState.IsDown)
                        {
                            downLSState.IsDown      = true;
                            downLSState.LastDepress = EntityModule.ElapsedTime;
                            downLSState.LastTrigger = EntityModule.ElapsedTime;
                            var triggerDownLocal    = triggerDown;
                            if (triggerDownLocal != null && !isTransitioning)
                            {
                                triggerDownLocal();
                            }
                        }
                    }
                    else
                    {
                        downLSState.IsDown = false;
                    }

                    if (y >= threshold)
                    {
                        if (!upLSState.IsDown)
                        {
                            upLSState.IsDown      = true;
                            upLSState.LastDepress = EntityModule.ElapsedTime;
                            upLSState.LastTrigger = EntityModule.ElapsedTime;
                            var triggerUpLocal    = triggerUp;
                            if (triggerUpLocal != null && !isTransitioning)
                            {
                                triggerUpLocal();
                            }
                        }
                    }
                    else
                    {
                        upLSState.IsDown = false;
                    }

                    if (x <= -threshold)
                    {
                        if (!leftLSState.IsDown)
                        {
                            leftLSState.IsDown      = true;
                            leftLSState.LastDepress = EntityModule.ElapsedTime;
                            leftLSState.LastTrigger = EntityModule.ElapsedTime;
                            var triggerLeftLocal    = triggerLeft;
                            if (triggerLeftLocal != null && !isTransitioning)
                            {
                                triggerLeftLocal();
                            }
                        }
                    }
                    else
                    {
                        leftLSState.IsDown = false;
                    }

                    if (x >= threshold)
                    {
                        if (!rightLSState.IsDown)
                        {
                            rightLSState.IsDown      = true;
                            rightLSState.LastDepress = EntityModule.ElapsedTime;
                            rightLSState.LastTrigger = EntityModule.ElapsedTime;
                            var triggerRightLocal    = triggerRight;
                            if (triggerRightLocal != null && !isTransitioning)
                            {
                                triggerRightLocal();
                            }
                        }
                    }
                    else
                    {
                        rightLSState.IsDown = false;
                    }
                }
            });
            hudIPB.RegisterButtonEvent(
                new HashSet <ButtonFlags> {
                ButtonFlags.XINPUT_GAMEPAD_A
            },
                VirtualKeyState.KeyDown,
                (_, __, ___) => {
                lock (staticMutationLock) {
                    if (currentMenuState == MenuState.InGame)
                    {
                        return;
                    }
                    var triggerConfirmLocal = triggerConfirm;
                    if (triggerConfirmLocal != null && !isTransitioning)
                    {
                        triggerConfirmLocal();
                    }
                }
            }
                );
            hudIPB.RegisterButtonEvent(
                new HashSet <ButtonFlags> {
                ButtonFlags.XINPUT_GAMEPAD_B
            },
                VirtualKeyState.KeyDown,
                (_, __, ___) => {
                lock (staticMutationLock) {
                    if (currentMenuState == MenuState.InGame)
                    {
                        return;
                    }
                    var triggerBackOutLocal = triggerBackOut;
                    if (triggerBackOutLocal != null && !isTransitioning)
                    {
                        triggerBackOutLocal();
                    }
                }
            }
                );
            hudIPB.RegisterButtonEvent(
                new HashSet <ButtonFlags> {
                ButtonFlags.XINPUT_GAMEPAD_DPAD_DOWN, ButtonFlags.XINPUT_GAMEPAD_DPAD_UP, ButtonFlags.XINPUT_GAMEPAD_DPAD_LEFT, ButtonFlags.XINPUT_GAMEPAD_DPAD_RIGHT
            },
                VirtualKeyState.KeyDown | VirtualKeyState.KeyUp,
                (key, state, ___) => {
                lock (staticMutationLock) {
                    if (currentMenuState == MenuState.InGame)
                    {
                        return;
                    }
                    if (state == VirtualKeyState.KeyDown)
                    {
                        switch (key)
                        {
                        case ButtonFlags.XINPUT_GAMEPAD_DPAD_DOWN:
                            downKeyState.IsDown      = true;
                            downKeyState.LastDepress = EntityModule.ElapsedTime;
                            downKeyState.LastTrigger = EntityModule.ElapsedTime;
                            var triggerDownLocal     = triggerDown;
                            if (triggerDownLocal != null && !isTransitioning)
                            {
                                triggerDownLocal();
                            }
                            break;

                        case ButtonFlags.XINPUT_GAMEPAD_DPAD_UP:
                            upKeyState.IsDown      = true;
                            upKeyState.LastDepress = EntityModule.ElapsedTime;
                            upKeyState.LastTrigger = EntityModule.ElapsedTime;
                            var triggerUpLocal     = triggerUp;
                            if (triggerUpLocal != null && !isTransitioning)
                            {
                                triggerUpLocal();
                            }
                            break;

                        case ButtonFlags.XINPUT_GAMEPAD_DPAD_LEFT:
                            leftKeyState.IsDown      = true;
                            leftKeyState.LastDepress = EntityModule.ElapsedTime;
                            leftKeyState.LastTrigger = EntityModule.ElapsedTime;
                            var triggerLeftLocal     = triggerLeft;
                            if (triggerLeftLocal != null && !isTransitioning)
                            {
                                triggerLeftLocal();
                            }
                            break;

                        case ButtonFlags.XINPUT_GAMEPAD_DPAD_RIGHT:
                            rightKeyState.IsDown      = true;
                            rightKeyState.LastDepress = EntityModule.ElapsedTime;
                            rightKeyState.LastTrigger = EntityModule.ElapsedTime;
                            var triggerRightLocal     = triggerRight;
                            if (triggerRightLocal != null && !isTransitioning)
                            {
                                triggerRightLocal();
                            }
                            break;
                        }
                    }
                    else
                    {
                        switch (key)
                        {
                        case ButtonFlags.XINPUT_GAMEPAD_DPAD_DOWN:
                            downKeyState.IsDown = false;
                            break;

                        case ButtonFlags.XINPUT_GAMEPAD_DPAD_UP:
                            upKeyState.IsDown = false;
                            break;

                        case ButtonFlags.XINPUT_GAMEPAD_DPAD_LEFT:
                            leftKeyState.IsDown = false;
                            break;

                        case ButtonFlags.XINPUT_GAMEPAD_DPAD_RIGHT:
                            rightKeyState.IsDown = false;
                            break;
                        }
                    }
                }
            }
                );
            hudIPB.RegisterKeyEvent(
                new HashSet <VirtualKey> {
                VirtualKey.Enter, VirtualKey.Space
            },
                VirtualKeyState.KeyDown,
                (_, __) => {
                lock (staticMutationLock) {
                    if (currentMenuState == MenuState.InGame)
                    {
                        return;
                    }
                    var triggerConfirmLocal = triggerConfirm;
                    if (triggerConfirmLocal != null && !isTransitioning)
                    {
                        triggerConfirmLocal();
                    }
                }
            }
                );
            hudIPB.RegisterKeyEvent(
                new HashSet <VirtualKey> {
                VirtualKey.Back, VirtualKey.Escape
            },
                VirtualKeyState.KeyDown,
                (_, __) => {
                lock (staticMutationLock) {
                    if (currentMenuState == MenuState.InGame)
                    {
                        return;
                    }
                    var triggerBackOutLocal = triggerBackOut;
                    if (triggerBackOutLocal != null && !isTransitioning)
                    {
                        triggerBackOutLocal();
                    }
                }
            }
                );
            hudIPB.RegisterKeyEvent(
                new HashSet <VirtualKey> {
                VirtualKey.Down, VirtualKey.Up, VirtualKey.Left, VirtualKey.Right
            },
                VirtualKeyState.KeyDown | VirtualKeyState.KeyUp,
                (key, state) => {
                lock (staticMutationLock) {
                    if (currentMenuState == MenuState.InGame)
                    {
                        return;
                    }
                    if (state == VirtualKeyState.KeyDown)
                    {
                        switch (key)
                        {
                        case VirtualKey.Down:
                            downKeyState.IsDown      = true;
                            downKeyState.LastDepress = EntityModule.ElapsedTime;
                            downKeyState.LastTrigger = EntityModule.ElapsedTime;
                            var triggerDownLocal     = triggerDown;
                            if (triggerDownLocal != null && !isTransitioning)
                            {
                                triggerDownLocal();
                            }
                            break;

                        case VirtualKey.Up:
                            upKeyState.IsDown      = true;
                            upKeyState.LastDepress = EntityModule.ElapsedTime;
                            upKeyState.LastTrigger = EntityModule.ElapsedTime;
                            var triggerUpLocal     = triggerUp;
                            if (triggerUpLocal != null && !isTransitioning)
                            {
                                triggerUpLocal();
                            }
                            break;

                        case VirtualKey.Left:
                            leftKeyState.IsDown      = true;
                            leftKeyState.LastDepress = EntityModule.ElapsedTime;
                            leftKeyState.LastTrigger = EntityModule.ElapsedTime;
                            var triggerLeftLocal     = triggerLeft;
                            if (triggerLeftLocal != null && !isTransitioning)
                            {
                                triggerLeftLocal();
                            }
                            break;

                        case VirtualKey.Right:
                            rightKeyState.IsDown      = true;
                            rightKeyState.LastDepress = EntityModule.ElapsedTime;
                            rightKeyState.LastTrigger = EntityModule.ElapsedTime;
                            var triggerRightLocal     = triggerRight;
                            if (triggerRightLocal != null && !isTransitioning)
                            {
                                triggerRightLocal();
                            }
                            break;
                        }
                    }
                    else
                    {
                        switch (key)
                        {
                        case VirtualKey.Down:
                            downKeyState.IsDown = false;
                            break;

                        case VirtualKey.Up:
                            upKeyState.IsDown = false;
                            break;

                        case VirtualKey.Left:
                            leftKeyState.IsDown = false;
                            break;

                        case VirtualKey.Right:
                            rightKeyState.IsDown = false;
                            break;
                        }
                    }
                }
            }
                );
        }
        private static void MainMenuDisposeComponents()
        {
            triggerUp      -= MainMenuChangeOptionUp;
            triggerRight   -= MainMenuChangeOptionUp;
            triggerDown    -= MainMenuChangeOptionDown;
            triggerLeft    -= MainMenuChangeOptionDown;
            triggerConfirm -= MainMenuConfirmOption;
            triggerBackOut -= MainMenuBackOut;
            tick           -= MainMenuTick;

            if (mainMenuELLogo != null)
            {
                mainMenuELLogo.Dispose();
                mainMenuELLogo = null;
            }
            foreach (var confetto in mainMenuELLogoConfetti.Keys)
            {
                confetto.Dispose();
            }
            mainMenuELLogoConfetti.Clear();

            if (mainMenuPlayButtonL != null)
            {
                mainMenuPlayButtonL.Dispose();
                mainMenuPlayButtonL = null;
            }
            if (mainMenuPlayButtonR != null)
            {
                mainMenuPlayButtonR.Dispose();
                mainMenuPlayButtonR = null;
            }
            if (mainMenuMedalsButtonL != null)
            {
                mainMenuMedalsButtonL.Dispose();
                mainMenuMedalsButtonL = null;
            }
            if (mainMenuMedalsButtonR != null)
            {
                mainMenuMedalsButtonR.Dispose();
                mainMenuMedalsButtonR = null;
            }
            if (mainMenuOptionsButtonL != null)
            {
                mainMenuOptionsButtonL.Dispose();
                mainMenuOptionsButtonL = null;
            }
            if (mainMenuOptionsButtonR != null)
            {
                mainMenuOptionsButtonR.Dispose();
                mainMenuOptionsButtonR = null;
            }
            if (mainMenuExitButtonL != null)
            {
                mainMenuExitButtonL.Dispose();
                mainMenuExitButtonL = null;
            }
            if (mainMenuExitButtonR != null)
            {
                mainMenuExitButtonR.Dispose();
                mainMenuExitButtonR = null;
            }
            if (mainMenuButtonFrontL != null)
            {
                mainMenuButtonFrontL.Dispose();
                mainMenuButtonFrontL = null;
            }
            if (mainMenuButtonFrontR != null)
            {
                mainMenuButtonFrontR.Dispose();
                mainMenuButtonFrontR = null;
            }
            if (mainMenuButtonRingL != null)
            {
                mainMenuButtonRingL.Dispose();
                mainMenuButtonRingL = null;
            }
            if (mainMenuButtonRingR != null)
            {
                mainMenuButtonRingR.Dispose();
                mainMenuButtonRingR = null;
            }
            if (mainMenuButtonRingExciterL != null)
            {
                mainMenuButtonRingExciterL.Dispose();
                mainMenuButtonRingExciterL = null;
            }
            if (mainMenuButtonRingExciterR != null)
            {
                mainMenuButtonRingExciterR.Dispose();
                mainMenuButtonRingExciterR = null;
            }
            if (mainMenuPlayString != null)
            {
                mainMenuPlayString.Dispose();
                mainMenuPlayString = null;
            }
            if (mainMenuMedalsString != null)
            {
                mainMenuMedalsString.Dispose();
                mainMenuMedalsString = null;
            }
            if (mainMenuOptionsString != null)
            {
                mainMenuOptionsString.Dispose();
                mainMenuOptionsString = null;
            }
            if (mainMenuExitString != null)
            {
                mainMenuExitString.Dispose();
                mainMenuExitString = null;
            }
            if (mainMenuStringExciter != null)
            {
                mainMenuStringExciter.Dispose();
                mainMenuStringExciter = null;
            }

            if (mainMenuExitConfirmQuestionString != null)
            {
                mainMenuExitConfirmQuestionString.Dispose();
                mainMenuExitConfirmQuestionString = null;
            }
            if (mainMenuExitConfirmYesString != null)
            {
                mainMenuExitConfirmYesString.Dispose();
                mainMenuExitConfirmYesString = null;
            }
            if (mainMenuExitConfirmNoString != null)
            {
                mainMenuExitConfirmNoString.Dispose();
                mainMenuExitConfirmNoString = null;
            }
        }
        private static void MainMenuCreateComponents()
        {
            MainMenuDisposeComponents();

            triggerUp      += MainMenuChangeOptionUp;
            triggerRight   += MainMenuChangeOptionUp;
            triggerDown    += MainMenuChangeOptionDown;
            triggerLeft    += MainMenuChangeOptionDown;
            triggerConfirm += MainMenuConfirmOption;
            triggerBackOut += MainMenuBackOut;
            tick           += MainMenuTick;

            mainMenuInExitConfirmationScreen = false;

            mainMenuELLogo = new HUDTexture(AssetLocator.HUDFragmentShader, AssetLocator.HudLayer, AssetLocator.MainWindow)
            {
                Anchoring                = ViewportAnchoring.TopCentered,
                AnchorOffset             = new Vector2(0f, 0.01f),
                AspectCorrectionStrategy = HUDTexture.AspectRatioCorrectionStrategy.UseBestUniformScaling,
                Color    = new Vector4(1f, 1f, 1f, 1f),
                Rotation = 0f,
                Scale    = new Vector2(0f, 0f),
                Texture  = AssetLocator.ELLogo,
                ZIndex   = 3
            };

            for (int i = 0; i < MAIN_MENU_EL_LOGO_LOW_CONFETTI_COUNT * Config.PhysicsLevel; ++i)
            {
                ITexture2D texture;
                switch (i % 4)
                {
                case 0: texture = AssetLocator.GoldStar; break;

                case 1: texture = AssetLocator.SilverStar; break;

                case 2: texture = AssetLocator.BronzeStar; break;

                default: texture = AssetLocator.CoinFrames[0]; break;
                }
                var confetto = new HUDTexture(AssetLocator.HUDFragmentShader, AssetLocator.HudLayer, AssetLocator.MainWindow)
                {
                    Anchoring                = ViewportAnchoring.TopLeft,
                    AnchorOffset             = new Vector2(0.5f, mainMenuELLogo.AnchorOffset.Y),
                    AspectCorrectionStrategy = HUDTexture.AspectRatioCorrectionStrategy.UseBestUniformScaling,
                    Color    = new Vector4(1f, 1f, 1f, 1f),
                    Rotation = 0f,
                    Scale    = new Vector2(0.1f, 0.1f),
                    Texture  = texture,
                    ZIndex   = mainMenuELLogo.ZIndex - 1
                };
                Vector2 initialVelo = new Vector2(
                    RandomProvider.Next(-0.5f, 0.5f),
                    RandomProvider.Next(-0.5f, 0.5f)
                    );
                float initialSpin = RandomProvider.Next(-MathUtils.PI, MathUtils.PI);
                mainMenuELLogoConfetti.Add(confetto, new Vector4(initialVelo, z: initialSpin, w: texture == AssetLocator.CoinFrames[0] ? 32f : 0f));
            }

            mainMenuPlayButtonL = new HUDTexture(AssetLocator.HUDFragmentShader, AssetLocator.HudLayer, AssetLocator.MainWindow)
            {
                Anchoring                = ViewportAnchoring.TopRight,
                AnchorOffset             = new Vector2(0.37f + MAIN_MENU_BUTTON_TRANSITION_HORIZONTAL_OFFSET, MAIN_MENU_BUTTONS_START_HEIGHT + MAIN_MENU_BUTTONS_ROW_HEIGHT * 0),
                AspectCorrectionStrategy = HUDTexture.AspectRatioCorrectionStrategy.UseBestUniformScaling,
                Color    = new Vector4(1f, 1f, 1f, 0f),
                Rotation = 0f,
                Scale    = MAIN_MENU_BUTTON_SCALE,
                Texture  = AssetLocator.MainMenuPlayButton,
                ZIndex   = 3
            };
            mainMenuPlayButtonR = new HUDTexture(AssetLocator.HUDFragmentShader, AssetLocator.HudLayer, AssetLocator.MainWindow)
            {
                Anchoring                = ViewportAnchoring.TopLeft,
                AnchorOffset             = new Vector2(0.37f + MAIN_MENU_BUTTON_TRANSITION_HORIZONTAL_OFFSET, MAIN_MENU_BUTTONS_START_HEIGHT + MAIN_MENU_BUTTONS_ROW_HEIGHT * 0),
                AspectCorrectionStrategy = HUDTexture.AspectRatioCorrectionStrategy.UseBestUniformScaling,
                Color    = new Vector4(1f, 1f, 1f, 0f),
                Rotation = 0f,
                Scale    = MAIN_MENU_BUTTON_SCALE,
                Texture  = AssetLocator.MainMenuPlayButton,
                ZIndex   = 3
            };

            mainMenuMedalsButtonL = new HUDTexture(AssetLocator.HUDFragmentShader, AssetLocator.HudLayer, AssetLocator.MainWindow)
            {
                Anchoring                = ViewportAnchoring.TopRight,
                AnchorOffset             = new Vector2(0.41f + MAIN_MENU_BUTTON_TRANSITION_HORIZONTAL_OFFSET, MAIN_MENU_BUTTONS_START_HEIGHT + MAIN_MENU_BUTTONS_ROW_HEIGHT * 1),
                AspectCorrectionStrategy = HUDTexture.AspectRatioCorrectionStrategy.UseBestUniformScaling,
                Color    = new Vector4(1f, 1f, 1f, 0f),
                Rotation = 0f,
                Scale    = MAIN_MENU_BUTTON_SCALE,
                Texture  = AssetLocator.MainMenuMedalsButton,
                ZIndex   = 3
            };
            mainMenuMedalsButtonR = new HUDTexture(AssetLocator.HUDFragmentShader, AssetLocator.HudLayer, AssetLocator.MainWindow)
            {
                Anchoring                = ViewportAnchoring.TopLeft,
                AnchorOffset             = new Vector2(0.41f + MAIN_MENU_BUTTON_TRANSITION_HORIZONTAL_OFFSET, MAIN_MENU_BUTTONS_START_HEIGHT + MAIN_MENU_BUTTONS_ROW_HEIGHT * 1),
                AspectCorrectionStrategy = HUDTexture.AspectRatioCorrectionStrategy.UseBestUniformScaling,
                Color    = new Vector4(1f, 1f, 1f, 0f),
                Rotation = 0f,
                Scale    = MAIN_MENU_BUTTON_SCALE,
                Texture  = AssetLocator.MainMenuMedalsButton,
                ZIndex   = 3
            };

            mainMenuOptionsButtonL = new HUDTexture(AssetLocator.HUDFragmentShader, AssetLocator.HudLayer, AssetLocator.MainWindow)
            {
                Anchoring                = ViewportAnchoring.TopRight,
                AnchorOffset             = new Vector2(0.42f + MAIN_MENU_BUTTON_TRANSITION_HORIZONTAL_OFFSET, MAIN_MENU_BUTTONS_START_HEIGHT + MAIN_MENU_BUTTONS_ROW_HEIGHT * 2),
                AspectCorrectionStrategy = HUDTexture.AspectRatioCorrectionStrategy.UseBestUniformScaling,
                Color    = new Vector4(1f, 1f, 1f, 0f),
                Rotation = 0f,
                Scale    = MAIN_MENU_BUTTON_SCALE,
                Texture  = AssetLocator.MainMenuOptionsButton,
                ZIndex   = 3
            };
            mainMenuOptionsButtonR = new HUDTexture(AssetLocator.HUDFragmentShader, AssetLocator.HudLayer, AssetLocator.MainWindow)
            {
                Anchoring                = ViewportAnchoring.TopLeft,
                AnchorOffset             = new Vector2(0.42f + MAIN_MENU_BUTTON_TRANSITION_HORIZONTAL_OFFSET, MAIN_MENU_BUTTONS_START_HEIGHT + MAIN_MENU_BUTTONS_ROW_HEIGHT * 2),
                AspectCorrectionStrategy = HUDTexture.AspectRatioCorrectionStrategy.UseBestUniformScaling,
                Color    = new Vector4(1f, 1f, 1f, 0f),
                Rotation = 0f,
                Scale    = MAIN_MENU_BUTTON_SCALE,
                Texture  = AssetLocator.MainMenuOptionsButton,
                ZIndex   = 3
            };

            mainMenuExitButtonL = new HUDTexture(AssetLocator.HUDFragmentShader, AssetLocator.HudLayer, AssetLocator.MainWindow)
            {
                Anchoring                = ViewportAnchoring.TopRight,
                AnchorOffset             = new Vector2(0.37f + MAIN_MENU_BUTTON_TRANSITION_HORIZONTAL_OFFSET, MAIN_MENU_BUTTONS_START_HEIGHT + MAIN_MENU_BUTTONS_ROW_HEIGHT * 3),
                AspectCorrectionStrategy = HUDTexture.AspectRatioCorrectionStrategy.UseBestUniformScaling,
                Color    = new Vector4(1f, 1f, 1f, 0f),
                Rotation = 0f,
                Scale    = MAIN_MENU_BUTTON_SCALE,
                Texture  = AssetLocator.MainMenuExitButton,
                ZIndex   = 3
            };
            mainMenuExitButtonR = new HUDTexture(AssetLocator.HUDFragmentShader, AssetLocator.HudLayer, AssetLocator.MainWindow)
            {
                Anchoring                = ViewportAnchoring.TopLeft,
                AnchorOffset             = new Vector2(0.37f + MAIN_MENU_BUTTON_TRANSITION_HORIZONTAL_OFFSET, MAIN_MENU_BUTTONS_START_HEIGHT + MAIN_MENU_BUTTONS_ROW_HEIGHT * 3),
                AspectCorrectionStrategy = HUDTexture.AspectRatioCorrectionStrategy.UseBestUniformScaling,
                Color    = new Vector4(1f, 1f, 1f, 0f),
                Rotation = 0f,
                Scale    = MAIN_MENU_BUTTON_SCALE,
                Texture  = AssetLocator.MainMenuExitButton,
                ZIndex   = 3
            };



            mainMenuButtonFrontL = new HUDTexture(AssetLocator.HUDFragmentShader, AssetLocator.HudLayer, AssetLocator.MainWindow)
            {
                Anchoring                = mainMenuPlayButtonL.Anchoring,
                AnchorOffset             = mainMenuPlayButtonL.AnchorOffset,
                AspectCorrectionStrategy = mainMenuPlayButtonL.AspectCorrectionStrategy,
                Color    = new Vector4(1f, 1f, 1f, 0f),
                Rotation = 0f,
                Scale    = MAIN_MENU_BUTTON_SCALE,
                Texture  = AssetLocator.MainMenuPlayButtonFront,
                ZIndex   = 4
            };
            mainMenuButtonFrontR = new HUDTexture(AssetLocator.HUDFragmentShader, AssetLocator.HudLayer, AssetLocator.MainWindow)
            {
                Anchoring                = mainMenuPlayButtonR.Anchoring,
                AnchorOffset             = mainMenuPlayButtonR.AnchorOffset,
                AspectCorrectionStrategy = mainMenuPlayButtonR.AspectCorrectionStrategy,
                Color    = new Vector4(1f, 1f, 1f, 0f),
                Rotation = 0f,
                Scale    = MAIN_MENU_BUTTON_SCALE,
                Texture  = AssetLocator.MainMenuPlayButtonFront,
                ZIndex   = 4
            };

            mainMenuButtonRingL = new HUDTexture(AssetLocator.HUDFragmentShader, AssetLocator.HudLayer, AssetLocator.MainWindow)
            {
                Anchoring                = mainMenuPlayButtonL.Anchoring,
                AnchorOffset             = mainMenuPlayButtonL.AnchorOffset,
                AspectCorrectionStrategy = mainMenuPlayButtonL.AspectCorrectionStrategy,
                Color    = new Vector4(1f, 1f, 1f, 0f),
                Rotation = 0f,
                Scale    = MAIN_MENU_BUTTON_SCALE,
                Texture  = AssetLocator.MainMenuButtonRing,
                ZIndex   = 2
            };
            mainMenuButtonRingR = new HUDTexture(AssetLocator.HUDFragmentShader, AssetLocator.HudLayer, AssetLocator.MainWindow)
            {
                Anchoring                = mainMenuPlayButtonR.Anchoring,
                AnchorOffset             = mainMenuPlayButtonR.AnchorOffset,
                AspectCorrectionStrategy = mainMenuPlayButtonR.AspectCorrectionStrategy,
                Color    = new Vector4(1f, 1f, 1f, 0f),
                Rotation = 0f,
                Scale    = MAIN_MENU_BUTTON_SCALE,
                Texture  = AssetLocator.MainMenuButtonRing,
                ZIndex   = 2
            };

            mainMenuButtonRingExciterL = new HUDItemExciterEntity(mainMenuButtonRingL)
            {
                OpacityMultiplier = 0.066f,
                Lifetime          = 0.8f,
                Speed             = 0.06f,
                CountPerSec       = 60
            };
            mainMenuButtonRingExciterR = new HUDItemExciterEntity(mainMenuButtonRingR)
            {
                OpacityMultiplier = mainMenuButtonRingExciterL.OpacityMultiplier,
                Lifetime          = mainMenuButtonRingExciterL.Lifetime,
                Speed             = mainMenuButtonRingExciterL.Speed,
                CountPerSec       = mainMenuButtonRingExciterL.CountPerSec
            };

            mainMenuPlayString = AssetLocator.TitleFontGlow.AddString(
                AssetLocator.HudLayer,
                AssetLocator.MainWindow,
                ViewportAnchoring.TopCentered,
                new Vector2(0.0f, MAIN_MENU_BUTTONS_START_HEIGHT + MAIN_MENU_BUTTONS_ROW_HEIGHT * 0 + MAIN_MENU_TEXT_OFFSET_Y),
                MAIN_MENU_TEXT_SCALE
                );
            mainMenuPlayString.Color = new Vector4(MAIN_MENU_STRING_COLOR, w: 0f);
            mainMenuPlayString.Text  = "PLAY";

            mainMenuMedalsString = AssetLocator.TitleFontGlow.AddString(
                AssetLocator.HudLayer,
                AssetLocator.MainWindow,
                ViewportAnchoring.TopCentered,
                new Vector2(0.0f, MAIN_MENU_BUTTONS_START_HEIGHT + MAIN_MENU_BUTTONS_ROW_HEIGHT * 1 + MAIN_MENU_TEXT_OFFSET_Y),
                MAIN_MENU_TEXT_SCALE
                );
            mainMenuMedalsString.Color = new Vector4(MAIN_MENU_STRING_COLOR, w: 0f);
            mainMenuMedalsString.Text  = "MEDALS";

            mainMenuOptionsString = AssetLocator.TitleFontGlow.AddString(
                AssetLocator.HudLayer,
                AssetLocator.MainWindow,
                ViewportAnchoring.TopCentered,
                new Vector2(0.0f, MAIN_MENU_BUTTONS_START_HEIGHT + MAIN_MENU_BUTTONS_ROW_HEIGHT * 2 + MAIN_MENU_TEXT_OFFSET_Y),
                MAIN_MENU_TEXT_SCALE
                );
            mainMenuOptionsString.Color = new Vector4(MAIN_MENU_STRING_COLOR, w: 0f);
            mainMenuOptionsString.Text  = "OPTIONS";

            mainMenuExitString = AssetLocator.TitleFontGlow.AddString(
                AssetLocator.HudLayer,
                AssetLocator.MainWindow,
                ViewportAnchoring.TopCentered,
                new Vector2(0.0f, MAIN_MENU_BUTTONS_START_HEIGHT + MAIN_MENU_BUTTONS_ROW_HEIGHT * 3 + MAIN_MENU_TEXT_OFFSET_Y),
                MAIN_MENU_TEXT_SCALE
                );
            mainMenuExitString.Color = new Vector4(MAIN_MENU_STRING_COLOR, w: 0f);
            mainMenuExitString.Text  = "QUIT";

            mainMenuStringExciter = new HUDItemExciterEntity(null);

            mainMenuExitConfirmQuestionString = AssetLocator.TitleFont.AddString(
                AssetLocator.HudLayer,
                AssetLocator.MainWindow,
                ViewportAnchoring.TopCentered,
                new Vector2(0f, 0.475f),
                MAIN_MENU_EXIT_ANSWER_SCALE
                );
            mainMenuExitConfirmQuestionString.Color = new Vector4(MAIN_MENU_EXIT_QUESTION_COLOR, w: 0f);
            mainMenuExitConfirmQuestionString.Text  = "Exit Game?";

            mainMenuExitConfirmYesString = AssetLocator.TitleFont.AddString(
                AssetLocator.HudLayer,
                AssetLocator.MainWindow,
                ViewportAnchoring.TopRight,
                new Vector2(0.6f, 0.6f),
                MAIN_MENU_EXIT_SELECTED_ANSWER_SCALE
                );
            mainMenuExitConfirmYesString.Color = new Vector4(MAIN_MENU_EXIT_ANSWER_COLOR, w: 0f);
            mainMenuExitConfirmYesString.Text  = "YES";

            mainMenuExitConfirmNoString = AssetLocator.TitleFont.AddString(
                AssetLocator.HudLayer,
                AssetLocator.MainWindow,
                ViewportAnchoring.TopLeft,
                new Vector2(0.64f, 0.6f),
                MAIN_MENU_EXIT_ANSWER_SCALE
                );
            mainMenuExitConfirmNoString.Color = new Vector4(MAIN_MENU_EXIT_ANSWER_COLOR, w: 0f);
            mainMenuExitConfirmNoString.Text  = "NO";
        }