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


C# Sprite.AddAnimationFrame方法代碼示例

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


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

示例1: Line

        public Line(Vector2 position, int width, Color color)
        {
            Rectangle dimensions = new Rectangle(0, 0, width, defaultLineHeight);
            LineSprite = new Sprite<byte>(TextureManager.SingleWhitePixel,
                position, dimensions);

            LineSprite.Color = color;
            LineSprite.AddAnimationFrame(0, dimensions);
            LineSprite.ActiveAnimation = 0;
        }
開發者ID:Linusa,項目名稱:AI_Project,代碼行數:10,代碼來源:Line.cs

示例2: RadarDebugger

        public RadarDebugger(Radar radar)
        {
            radarDebugging = radar;

            RadarSprite = new Sprite<byte>(TextureManager.RadarCircle, Vector2.Zero, SpriteDimensions);
            RadarSprite.AddAnimationFrame(0, SpriteDimensions);
            RadarSprite.ActiveAnimation = 0;

            resetScaleUp();
        }
開發者ID:Linusa,項目名稱:AI_Project,代碼行數:10,代碼來源:RadarDebugger.cs

示例3: GraphViewer

        public GraphViewer(GraphType graph)
        {
            Graph = graph;

            nodeSprite = new Sprite<byte>(TextureManager.RadarCircle, Vector2.Zero,
                RadarDebugger.SpriteDimensions);
            nodeSprite.AddAnimationFrame(0, RadarDebugger.SpriteDimensions);
            nodeSprite.ActiveAnimation = 0;

            float scale = 0.06f;
            nodeSprite.Scale(scale);
            nodeRadius = nodeSprite.Dimensions.Width / 2 * scale;

            inputTimer.Start();
        }
開發者ID:Linusa,項目名稱:AI_Project,代碼行數:15,代碼來源:GraphViewer.cs

示例4: initializeSprites

        protected virtual void initializeSprites()
        {
            Rectangle tileFrame = new Rectangle(0, 0, (int)TileSize.X, (int)TileSize.Y);

            grassTile = new Sprite<byte>(TextureManager.GrassTile, Vector2.Zero, tileFrame);
            grassTile.AddAnimationFrame(0, tileFrame);
            grassTile.ActiveAnimation = 0;
            grassTile.LayerDepth = AStarGame.DrawingOrder.Grass;

            wallTile = new Sprite<byte>(TextureManager.WallTile, Vector2.Zero, tileFrame);
            wallTile.AddAnimationFrame(0, tileFrame);
            wallTile.ActiveAnimation = 0;
            wallTile.LayerDepth = AStarGame.DrawingOrder.Wall;

            bushTile = new Sprite<byte>(TextureManager.BushTile, Vector2.Zero, tileFrame);
            bushTile.AddAnimationFrame(0, tileFrame);
            bushTile.ActiveAnimation = 0;
            bushTile.LayerDepth = AStarGame.DrawingOrder.Bush;
        }
開發者ID:Linusa,項目名稱:AI_Project,代碼行數:19,代碼來源:Map.cs


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