예제 #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
파일: Widget.cs 프로젝트: sing840722/FlyFly
 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
파일: Widget.cs 프로젝트: sing840722/FlyFly
 public WidgetText AddWidgetText(String text)
 {
     this.text = new WidgetText(text);
     texts.Add(this.text);
     return(this.text);
 }
예제 #7
0
파일: Widget.cs 프로젝트: sing840722/FlyFly
 public WidgetText AddWidgetText()
 {
     this.text = new WidgetText();
     texts.Add(this.text);
     return(this.text);
 }