Ejemplo n.º 1
0
        public override void Initialize()
        {
            int y_start = GameBase.WindowManager.HeightScaled / 2 +
                          (PlayerVs.Match != null && (PlayerVs.Match.matchTeamType == MatchTeamTypes.TagTeamVs || PlayerVs.Match.matchTeamType == MatchTeamTypes.TeamVs) ? 40 : -40);

            pSprite background = new pSprite(TextureManager.Load(@"inputoverlay-background"), Fields.TopLeft, Origins.TopLeft, Clocks.Game, new Vector2(GameBase.WindowManager.WidthScaled, y_start))
            {
                Rotation    = OsuMathHelper.PiOver2,
                VectorScale = new Vector2(1.05f, 1),
                AlwaysDraw  = true,
                Depth       = 0.9f
            };

            spriteManager.Add(background);

            float yOffset = 0;

            foreach (ButtonType b in Enum.GetValues(typeof(ButtonType)))
            {
                Vector2            pos    = new Vector2(GameBase.WindowManager.WidthScaled - 15, y_start + 19f + yOffset);
                InputOverlayButton button = new InputOverlayButton(b, pos);

                buttons.Add(button);
                spriteManager.Add(button.Sprites);

                yOffset += 29.5f;
            }

            base.Initialize();
        }
Ejemplo n.º 2
0
        private void SetButtonState(ButtonType buttonType, bool pressed)
        {
            InputOverlayButton k = buttons.Find(b => b.Type == buttonType);

            if (k == null)
            {
                return;
            }
            k.Pressed = pressed;
        }