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


C# AnimatedSprite類代碼示例

本文整理匯總了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();
        }
開發者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


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