本文整理汇总了C#中AnimatedSprite类的典型用法代码示例。如果您正苦于以下问题:C# AnimatedSprite类的具体用法?C# AnimatedSprite怎么用?C# AnimatedSprite使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
AnimatedSprite类属于命名空间,在下文中一共展示了AnimatedSprite类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: Initialize
public static void Initialize(GraphicsDevice device, ContentManager content)
{
HillSprite = new AnimatedSprite(content.Load<Texture2D>("Art/Z3 Art/Hill"));
HillSprite.SetOriginToCenter();
HillSprite.StartAnimation();
HillSprite.DrawArgs.Scale *= 0.5f;
ConfusedSprite = new AnimatedSprite(content.Load<Texture2D>("Art/Z3 Art/Stunned"), 2, TimeSpan.FromSeconds(0.25), true, -1, 0);
ConfusedSprite.SetOriginToCenter();
ConfusedSprite.StartAnimation();
DogHouseSprite = new AnimatedSprite(content.Load<Texture2D>("Art/Z3 Art/doghouse"));
DogHouseSprite.SetOriginToCenter();
DogHouseLowerSprite = new AnimatedSprite(content.Load<Texture2D>("Art/Z3 Art/doghouse lower"));
DogHouseLowerSprite.SetOriginToCenter();
HarmonyJousterStill = new AnimatedSprite(content.Load<Texture2D>("Art/Z3 Art/dog_still"), 8, TimeSpan.FromSeconds(0.1), true);
HarmonyJousterStill.SetOriginToCenter();
HarmonyJousterStill.StartAnimation();
DischordJousterStill = new AnimatedSprite(content.Load<Texture2D>("Art/Z3 Art/baddog_still"), 8, TimeSpan.FromSeconds(0.1), true);
DischordJousterStill.SetOriginToCenter();
DischordJousterStill.StartAnimation();
TennisBall = new AnimatedSprite(content.Load<Texture2D>("Art/Z3 Art/tennisball"));
TennisBall.SetOriginToCenter();
TennisBall.StartAnimation();
}
开发者ID:heyx3,项目名称:GGJ2014,代码行数:28,代码来源:ArtAssets3.cs
示例2: Options
public Options(ContentManager Content)
: base()
{
bBackground = new GUIItems.Background(Content);
sPixel = new AnimatedSprite(Content, "pixel");
sPixel.Colour = new Color(Color.Black, 1.0f);
sPixel.FrameHeight = 544;
sPixel.FrameWidth = 960;
sPixel.Alpha = 0.7f;
XOffset = 32;
YOffset = Dimensions.Height / 10;
#if DESKTOP
bMusic = new GUIItems.Button(Content, new Vector2(XOffset, YOffset * 3), "Music");
#endif
// Buttons
tbMinRooms = new Neuroleptic.Editor.GUI.Textbox(Content, new Vector2(XOffset, YOffset * 5),"Min Rooms");
tbMaxRooms = new Neuroleptic.Editor.GUI.Textbox(Content, new Vector2(XOffset, YOffset * 6),"Max Rooms");
tbMinRooms.CurrentString = Option.RoomsMin.ToString();
tbMaxRooms.CurrentString = Option.RoomsMax.ToString();
bControls = new GUIItems.Button(Content , new Vector2(XOffset, YOffset * 7), "Controls");
bBack = new GUIItems.Button(Content , new Vector2(XOffset, YOffset * 8), "Back");
}
开发者ID:ChocMaltHoney,项目名称:Neuroleptic,代码行数:26,代码来源:Options.cs
示例3: Main
//!---CONSTRUCTORS---!
public Main(ContentManager Content)
: base()
{
bBackground = new GUIItems.Background(Content);
sPixel = new AnimatedSprite(Content, "pixel");
sPixel.Colour = Color.Black;
sPixel.FrameHeight = 544;
sPixel.FrameWidth = 260;
sPixel.Alpha = 0.7f;
sPixel.Position = new Vector2(700, 0);
sLine = new AnimatedSprite(Content, "pixel");
sLine.Colour = Color.White;
sLine.FrameHeight = 544;
sLine.FrameWidth = 2;
sLine.Alpha = 0.7f;
sLine.Position = new Vector2(700, 0);
float XOffset = 32;
float YOffset = Dimensions.Height / 10;
bPlay = new GUIItems.Button(Content, new Vector2(XOffset, YOffset * 4), "Play");
bEditor = new GUIItems.Button(Content, new Vector2(XOffset, YOffset * 5), "Editor");
bOptions = new GUIItems.Button(Content, new Vector2(XOffset, YOffset * 6), "Options");
bHelp = new GUIItems.Button(Content, new Vector2(XOffset, YOffset * 7), "Help");
bQuit = new GUIItems.Button(Content, new Vector2(XOffset, YOffset * 8), "Quit");
bTest = new GUIItems.Button(Content, new Vector2(960 - 256 - 64, 544 - 128), "Test");
}
开发者ID:ChocMaltHoney,项目名称:Neuroleptic,代码行数:30,代码来源:Main.cs
示例4: Initialize
public override void Initialize(Vector2 position)
{
Active = true;
if(cType == CrystalType.blue)
{
SpriteAnimation = new AnimatedSprite(Globals.content.Load<Texture2D>("Sprites/Collectables/bluerelic"));
FrameAnimation relic = new FrameAnimation(1, 32, 32, 0, 0);
relic.FramesPerSecond = 1;
SpriteAnimation.Animations.Add("Relic", relic);
}
if(cType == CrystalType.red)
{
SpriteAnimation = new AnimatedSprite(Globals.content.Load<Texture2D>("Sprites/Collectables/redrelic"));
FrameAnimation relic = new FrameAnimation(1, 32, 32, 0, 0);
relic.FramesPerSecond = 1;
SpriteAnimation.Animations.Add("Relic", relic);
}
if(cType == CrystalType.green)
{
SpriteAnimation = new AnimatedSprite(Globals.crysTex = Globals.content.Load<Texture2D>("Sprites/Collectables/greenrelic"));
FrameAnimation relic = new FrameAnimation(1, 32, 32, 0, 0);
relic.FramesPerSecond = 1;
SpriteAnimation.Animations.Add("Relic", relic);
}
SpriteAnimation.CurrentAnimationName = "Relic";
SpriteAnimation.Position = position;
collectedEffect = Globals.content.Load<SoundEffect>("Sounds/Collect_Item");
}
开发者ID:eternalmatt,项目名称:Archanist-Tower,代码行数:30,代码来源:Crystal.cs
示例5: Initialize
public static void Initialize(GraphicsDevice gd, Microsoft.Xna.Framework.Content.ContentManager content)
{
DirtCloud = new AnimatedSprite(content.Load<Texture2D>("Art/Z3 Art/Dirt Particle"));
DirtCloud.DrawArgs.Scale = new Vector2(Scale * 0.25f);
DirtCloud.SetOriginToCenter();
DirtCloud.StartAnimation();
}
开发者ID:nolanmanning703,项目名称:GGJ2014,代码行数:7,代码来源:ParticleAssets3.cs
示例6: Initialize
public void Initialize()
{
parent.IsYoshi = true;
sprite = AnimatedSpriteFactory.Instance.BuildYoshiIdleSprite(parent.Position);
CollisionRectangle = sprite.SpriteDestinationRectangle;
ScoreSprite = new ScoreSprite("", parent.Position, false);
}
开发者ID:BoltThrower,项目名称:Super-Mario-World-1-1,代码行数:7,代码来源:YoshiIdle.cs
示例7: SmallMarioFlagSlide
public SmallMarioFlagSlide(IPlayableObject playableObject)
{
this.playableObject = playableObject;
this.playableObject.StarPower = false;
sprite = AnimatedSpriteFactory.Instance.BuildSmallFlagSlideMarioSprite();
this.playableObject.CollisionRectangle = sprite.SpriteDestinationRectangle;
}
开发者ID:BoltThrower,项目名称:Super-Mario-World-1-1,代码行数:7,代码来源:SmallMarioFlagSlide.cs
示例8: Fire
public Fire(int x, int y)
: base(null, TileType.Fire)
{
sprite = new AnimatedSprite(texture, 26, 26, 0.1f);
this.x = x;
this.y = y;
}
开发者ID:opot,项目名称:ColorWar,代码行数:7,代码来源:Fire.cs
示例9: Initialize
public void Initialize()
{
ScoreValue = GameValues.FloatingCoinScoreValue;
sprite = AnimatedSpriteFactory.Instance.BuildFloatingCoinSprite(parent.Position);
CollisionRectangle = sprite.SpriteDestinationRectangle;
ScoreSprite = new ScoreSprite(ScoreValue.ToString(), parent.Position, false);
}
开发者ID:BoltThrower,项目名称:Super-Mario-World-1-1,代码行数:7,代码来源:FloatingCoin.cs
示例10: BigRightCrouchingMario
public BigRightCrouchingMario(IPlayableObject playableObject)
{
this.playableObject = playableObject;
sprite = AnimatedSpriteFactory.Instance.BuildBigRightCrouchingMarioSprite();
this.playableObject.CollisionRectangle = sprite.SpriteDestinationRectangle;
crouchPressed = true;
}
开发者ID:BoltThrower,项目名称:Super-Mario-World-1-1,代码行数:7,代码来源:BigRightCrouchingMario.cs
示例11: ComingOutOfShellKoopa
public ComingOutOfShellKoopa(Vector2 position, Enemy parent)
{
this.parent = parent;
ScoreValue = GameValues.ComingOutOfShellKoopaScoreValue;
sprite = AnimatedSpriteFactory.Instance.BuildEnemyComingOutOfShellKoopaSprite(position);
CollisionRectangle = sprite.SpriteDestinationRectangle;
ScoreSprite = new ScoreSprite(ScoreValue.ToString(), position, false);
}
开发者ID:BoltThrower,项目名称:Super-Mario-World-1-1,代码行数:8,代码来源:ComingOutOfShellKoopa.cs
示例12: PopAnimation
public void PopAnimation(AnimatedSprite[] anim)
{
if (AnimationStack.Count > 0 && AnimationStack.Peek() == anim)
{
AnimationStack.Pop();
UpdateAnimation();
}
}
开发者ID:renaudbedard,项目名称:cooldog-assistant,代码行数:8,代码来源:DogPart.cs
示例13: PushAnimation
public void PushAnimation(AnimatedSprite[] anim)
{
if (AnimationStack.Count == 0 || AnimationStack.Peek() != anim)
{
AnimationStack.Push(anim);
UpdateAnimation();
}
}
开发者ID:renaudbedard,项目名称:cooldog-assistant,代码行数:8,代码来源:DogPart.cs
示例14: Initialize
public void Initialize()
{
ScoreValue = GameValues.StarScoreValue;
sprite = AnimatedSpriteFactory.Instance.BuildStarSprite(parent.Position);
CollisionRectangle = sprite.SpriteDestinationRectangle;
ScoreSprite = new ScoreSprite(ScoreValue.ToString(), parent.Position, false);
stoppingPosition = parent.Position.Y - CollisionRectangle.Height;
}
开发者ID:BoltThrower,项目名称:Super-Mario-World-1-1,代码行数:8,代码来源:Star.cs
示例15: SmallRightToBig
public SmallRightToBig(IPlayableObject playableObject)
{
this.playableObject = playableObject;
sprite = AnimatedSpriteFactory.Instance.BuildSmallRightMarioToBigMarioSprite();
growthBuffer = GameValues.MarioStateSmallToBigGrowthBuffer;
this.playableObject.CollisionRectangle = sprite.SpriteDestinationRectangle;
GameStateMachine.Instance.GameState = new MarioFreezeGameAnimationState();
}
开发者ID:BoltThrower,项目名称:Super-Mario-World-1-1,代码行数:8,代码来源:SmallRightToBigMario.cs
示例16: King
public King(IPlayableObject playableObject)
{
this.parent = playableObject;
this.Position = parent.Position;
sprite = AnimatedSpriteFactory.Instance.BuildKingSprite(parent.Position);
this.CollisionRectangle = sprite.SpriteDestinationRectangle;
}
开发者ID:BoltThrower,项目名称:King-of-the-Castle,代码行数:8,代码来源:King.cs
示例17: Switch
/// <summary>
/// Initializes a new instance of the <see cref="Switch"/> class.
/// </summary>
/// <param name="spriteBatch">The sprite batch to render sprites with.</param>
/// <param name="contentManager">The content manager to load assets with.</param>
/// <param name="physicsWorld">The game's physics world.</param>
/// <param name="position">The position of the switch.</param>
/// <param name="mineCart">The mine cart to activate.</param>
public Switch(SpriteBatch spriteBatch, ContentManager contentManager, ref World physicsWorld, Vector2 position, MineCart mineCart)
{
this.sprite = new AnimatedSprite();
this.activated = false;
this.mineCart = mineCart;
this.InitializeAndLoadSprites(spriteBatch, contentManager);
this.SetUpPhysics(ref physicsWorld, position);
}
开发者ID:K-Cully,项目名称:SticKart,代码行数:16,代码来源:Switch.cs
示例18: Initialize
public void Initialize()
{
ScoreValue = GameValues.RotatingCoinScoreValue;
sprite = AnimatedSpriteFactory.Instance.BuildRotatingCoinSprite(parent.Position);
CollisionRectangle = sprite.SpriteDestinationRectangle;
ScoreSprite = new ScoreSprite(ScoreValue.ToString(), parent.Position, false);
stoppingPosition = parent.Position.Y - GameValues.BlockRotatingCoinStoppingYPosition;
}
开发者ID:BoltThrower,项目名称:Super-Mario-World-1-1,代码行数:8,代码来源:RotatingCoin.cs
示例19: Initialize
public void Initialize()
{
ScoreValue = GameValues.Mushroom1UPScoreValue;
sprite = AnimatedSpriteFactory.Instance.BuildMushroom1UpSprite(parent.Position);
CollisionRectangle = sprite.SpriteDestinationRectangle;
ScoreSprite = new ScoreSprite(GameValues.Mushroom1UPScoreSpriteName, parent.Position, false);
stoppingPosition = parent.Position.Y - CollisionRectangle.Height;
}
开发者ID:BoltThrower,项目名称:Super-Mario-World-1-1,代码行数:8,代码来源:Mushroom1Up.cs
示例20: Bandit
public Bandit(IEnemy enemyObject)
{
this.parent = enemyObject;
this.Position = parent.Position;
sprite = AnimatedSpriteFactory.Instance.BuildBanditSprite(parent.Position);
this.CollisionRectangle = sprite.SpriteDestinationRectangle;
}
开发者ID:BoltThrower,项目名称:King-of-the-Castle,代码行数:8,代码来源:Bandit.cs
注:本文中的AnimatedSprite类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论