當前位置: 首頁>>代碼示例>>C#>>正文


C# Text.GetAnimation方法代碼示例

本文整理匯總了C#中Text.GetAnimation方法的典型用法代碼示例。如果您正苦於以下問題:C# Text.GetAnimation方法的具體用法?C# Text.GetAnimation怎麽用?C# Text.GetAnimation使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Text的用法示例。


在下文中一共展示了Text.GetAnimation方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: MakeHUD

        internal static void MakeHUD()
        {
            Text scoreText = new Text("scoreText", "Text", "Score:");
            scoreText.Pos = new Vector2(50, This.Game.GraphicsDevice.Viewport.Y);
            scoreText.DisplayColor = Color.AliceBlue;
            scoreText.Static = true;
            Text score = new Text("score", "Text", GameData.Score.ToString());
            score.Pos = new Vector2(scoreText.GetAnimation().Width + 50, This.Game.GraphicsDevice.Viewport.Y);
            score.DisplayColor = Color.AliceBlue;
            score.Static = true;
            score.UpdateBehavior = delegate()
            {
                score.Content = GameData.Score.ToString();
            };

            Text livesText = new Text("livesText", "Text", "Lives Remaining:");
            livesText.Pos = new Vector2(This.Game.GraphicsDevice.Viewport.X + This.Game.GraphicsDevice.Viewport.Width - livesText.GetAnimation().Width - 50,
                                        This.Game.GraphicsDevice.Viewport.Y);
            livesText.DisplayColor = Color.Red;
            livesText.Static = true;
            Text lives = new Text("lives", "Text", GameData.NumberOfLives.ToString());
            lives.Pos = new Vector2(This.Game.GraphicsDevice.Viewport.X + This.Game.GraphicsDevice.Viewport.Width - 50,
                                    This.Game.GraphicsDevice.Viewport.Y);
            lives.DisplayColor = Color.Red;
            lives.Static = true;
            lives.UpdateBehavior = delegate()
            {
                lives.Content = GameData.NumberOfLives.ToString();
            };
        }
開發者ID:vincentgarcia00,項目名稱:frostbyte-entertainment,代碼行數:30,代碼來源:LevelFunctions.cs


注:本文中的Text.GetAnimation方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。