本文整理汇总了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;
}
示例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();
}
示例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();
}
示例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;
}