Ejemplo n.º 1
0
        public void Draw(SpriteBatch spriteBatch, LoadButton loadButton, SaveButton saveButton)
        {
            if (AngryBallsEnvironment.gameState == AngryBallsEnvironment.GameState.dialog)
            {
                background.Draw(spriteBatch);

                if (loadButton.isClicked(Mouse.GetState()))
                {
                    labelStr = "Load Which Level?";
                }
                else if (saveButton.isClicked(Mouse.GetState()))
                {
                    labelStr = "New Level Name:";
                }

                if(!string.IsNullOrEmpty(labelStr))
                {
                    label.DrawStr(spriteBatch, labelStr, new Vector2(200, 375));
                }

                if (!string.IsNullOrEmpty(inputStr))
                {
                    input.DrawStr(spriteBatch, inputStr, new Vector2(300, 450));
                }
                okButton.Draw(spriteBatch);
                cancelButton.Draw(spriteBatch);
            }
            else
            {
                AngryBallsEnvironment.GetMap().Initialize(AngryBallsEnvironment.GameState.pause, inputStr);
            }
        }