Exemplo n.º 1
0
        public override void Render()
        {
            Draw.SpriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, SamplerState.PointClamp, null, RasterizerState.CullNone, null, Engine.ScreenMatrix);
            {
                var scale = 6;
                var size  = new Vector2(buffer.Width * scale, buffer.Height * scale);
                var pos   = new Vector2(Celeste.TargetWidth - size.X, Celeste.TargetHeight - size.Y) / 2f;
                var flip  = (SaveData.Instance != null && SaveData.Instance.Assists.MirrorMode);

                // surroundings
                GFX.Game["pico8/consoleBG"].Draw(Vector2.Zero, Vector2.Zero, Color.White, scale);

                // the buffer / emulator
                Draw.SpriteBatch.Draw(buffer, pos, buffer.Bounds, Color.White, 0f, Vector2.Zero, scale, (flip ? SpriteEffects.FlipHorizontally : SpriteEffects.None), 0);
            }
            Draw.SpriteBatch.End();

            // Pause Menu
            if (pauseMenu != null || pauseFade > 0)
            {
                Draw.SpriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, SamplerState.LinearClamp, null, RasterizerState.CullNone, null, Engine.ScreenMatrix);

                Draw.Rect(-1, -1, Celeste.TargetWidth + 2, Celeste.TargetHeight + 2, Color.Black * pauseFade);

                if (pauseMenu != null)
                {
                    pauseMenu.Render();
                }

                Draw.SpriteBatch.End();
            }

            base.Render();
        }
Exemplo n.º 2
0
        public override void Render()
        {
            if (ease > 0f)
            {
                Draw.Rect(-10f, -10f, 1940f, 1100f, Color.Black * ease * 0.4f);
            }
            base.Render();

            const float spacingX = 48f;
            const float spacingY = 64f;

            Vector2 posCenter = Position + new Vector2(1920f / 2f, 1080f / 2f);
            Vector2 pos;

            // Vector2 posInput = posCenter - new Vector2(spacingX * (digits.Length - 1f) / 2f, spacingY * 0.5f);
            Vector2 posInput = Position + new Vector2(384f, 1080f / 2f);

            pos = posInput;
            for (int i = 0; i < digits.Length; i++)
            {
                DrawOptionText(digits[i].ToString("X1"), pos + new Vector2(0f, wigglerDigits[i].Value * 8f), new Vector2(0f, 0.5f), Vector2.One, selectedDigit == i && !musicParamMenu.Focused, i <= 1);
                pos.X += spacingX;
            }

            // pos = posCenter + new Vector2(0f, spacingY * 0.5f + wigglerPath.Value * 2f);
            pos = posInput + new Vector2(spacingX * 2f, spacingY * 0.8f + wigglerPath.Value * 2f);
            ActiveFont.DrawOutline(selectedPath ?? "", pos, new Vector2(0f, 0.5f), Vector2.One * 0.75f, Color.White * ease, 2f, Color.Black * ease * ease * ease);

            pos = posInput + new Vector2(0f, spacingY * -0.8f + wigglerBankPath.Value * 2f);
            ActiveFont.DrawOutline(selectedBankPath ?? "", pos, new Vector2(0f, 0.5f), Vector2.One * 0.75f, Color.LightSlateGray * ease, 2f, Color.Black * ease * ease * ease);

            if (musicParamMenu.GetItems().Count > 0)
            {
                // Press...
                pos = posInput + new Vector2(0f, spacingY * 2f + wigglerBankPath.Value * 2f);
                ActiveFont.DrawOutline(Dialog.Clean("SOUNDTEST_AUDIOPARAMS_OPEN_1"), pos, new Vector2(0f, 0.5f), Vector2.One * 0.75f, Color.White * ease, 2f, Color.Black * ease * ease * ease);

                // ... [button image] ...
                pos.X += ActiveFont.Measure(Dialog.Clean("SOUNDTEST_AUDIOPARAMS_OPEN_1")).X * 0.75f + 10f;
                MTexture button = Input.GuiButton(Input.MenuJournal);
                button.DrawJustified(pos, new Vector2(0f, 0.5f), Color.White, 0.75f);
                pos.X += button.Width * 0.75f + 10f;

                // ... to edit Audio Params
                ActiveFont.DrawOutline(Dialog.Clean("SOUNDTEST_AUDIOPARAMS_OPEN_2"), pos, new Vector2(0f, 0.5f), Vector2.One * 0.75f, Color.White * ease, 2f, Color.Black * ease * ease * ease);
            }

            ActiveFont.DrawEdgeOutline(Dialog.Clean("soundtest_title"), Position + new Vector2(960f, 256f), new Vector2(0.5f, 0.5f), Vector2.One * 2f, Color.Gray, 4f, Color.DarkSlateBlue, 2f, Color.Black);

            if (musicParamMenuEase > 0f)
            {
                Draw.Rect(-10f, -10f, 1940f, 1100f, Color.Black * 0.95f * Ease.CubeInOut(musicParamMenuEase));
                musicParamMenu.Alpha = Ease.CubeInOut(musicParamMenuEase);
                musicParamMenu.Render();
            }
        }