示例#1
0
        //Create widgets for the end screen
        public void CreateEndScreenWidgets()
        {
            //Create widget object
            endScreen = new Widget(this);

            //Add background image, with default setting (full screen)
            endScreen.AddWidgetImage(endScreenContent.LeaderBoardTexture);

            //Add high scores
            for (int i = 0; i < scoreManager.LeaderBoard.Scores.Count; i++)
            {
                string     score     = scoreManager.LeaderBoard.Scores[i].ToString();
                WidgetText highScore = endScreen.AddWidgetText(score, new Vector2(SCREEN_WIDTH / 2, 475 + i * 85), new Vector2(0.75f));
            }
        }
示例#2
0
        //Create HUD for the level
        public void CreateLevelWidgets()
        {
            //create widget object
            levelHUD = new Widget(this);

            //create widget text object
            WidgetText score = levelHUD.AddWidgetText("Score", new Vector2(SCREEN_WIDTH / 2, 50), new Vector2(0.75f));

            //bind the text value to player score
            score.BindText += BindPlayerScore;

            //create widget text object
            WidgetText special = levelHUD.AddWidgetText("SpecialAttack", new Vector2(SCREEN_WIDTH - 150, 50), new Vector2(0.75f));

            //bind the text value to the number of remaining special attack
            special.BindText += BindPlayerSpecialAttack;
        }
示例#3
0
 //Bind the number of player special attack to a widget text object
 public void BindPlayerSpecialAttack(WidgetText text)
 {
     text.Text = player.Special.ToString();
 }
示例#4
0
 //Bind score to a widget text object
 public void BindPlayerScore(WidgetText text)
 {
     text.Text = scoreManager.Score.ToString();
 }
示例#5
0
 public WidgetText AddWidgetText(String text, Vector2 position, Vector2 scale)
 {
     this.text = new WidgetText(text, position, scale);
     texts.Add(this.text);
     return(this.text);
 }
示例#6
0
 public WidgetText AddWidgetText(String text)
 {
     this.text = new WidgetText(text);
     texts.Add(this.text);
     return(this.text);
 }
示例#7
0
 public WidgetText AddWidgetText()
 {
     this.text = new WidgetText();
     texts.Add(this.text);
     return(this.text);
 }