本文整理汇总了C#中AnimatedSprite类的典型用法代码示例。如果您正苦于以下问题:C# AnimatedSprite类的具体用法?C# AnimatedSprite怎么用?C# AnimatedSprite使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
AnimatedSprite类属于命名空间,在下文中一共展示了AnimatedSprite类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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();
}
示例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");
}
示例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");
}
示例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");
}
示例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();
}
示例6: Initialize
public void Initialize()
{
parent.IsYoshi = true;
sprite = AnimatedSpriteFactory.Instance.BuildYoshiIdleSprite(parent.Position);
CollisionRectangle = sprite.SpriteDestinationRectangle;
ScoreSprite = new ScoreSprite("", parent.Position, false);
}
示例7: SmallMarioFlagSlide
public SmallMarioFlagSlide(IPlayableObject playableObject)
{
this.playableObject = playableObject;
this.playableObject.StarPower = false;
sprite = AnimatedSpriteFactory.Instance.BuildSmallFlagSlideMarioSprite();
this.playableObject.CollisionRectangle = sprite.SpriteDestinationRectangle;
}
示例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;
}
示例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);
}
示例10: BigRightCrouchingMario
public BigRightCrouchingMario(IPlayableObject playableObject)
{
this.playableObject = playableObject;
sprite = AnimatedSpriteFactory.Instance.BuildBigRightCrouchingMarioSprite();
this.playableObject.CollisionRectangle = sprite.SpriteDestinationRectangle;
crouchPressed = true;
}
示例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);
}
示例12: PopAnimation
public void PopAnimation(AnimatedSprite[] anim)
{
if (AnimationStack.Count > 0 && AnimationStack.Peek() == anim)
{
AnimationStack.Pop();
UpdateAnimation();
}
}
示例13: PushAnimation
public void PushAnimation(AnimatedSprite[] anim)
{
if (AnimationStack.Count == 0 || AnimationStack.Peek() != anim)
{
AnimationStack.Push(anim);
UpdateAnimation();
}
}
示例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;
}
示例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();
}