public BoomerangItemSprite(Texture2D texture)
        {
            SpriteFrame Sprite1 = new SpriteFrame(texture, BOOMERANG_POS1_X, BOOMERANG_POS1_Y, BOOMERANG_WIDTH1, BOOMERANG_HEIGHT1);
            SpriteFrame Sprite2 = new SpriteFrame(texture, BOOMERANG_POS2_X, BOOMERANG_POS2_Y, BOOMERANG_WIDTH2, BOOMERANG_HEIGHT2);
            SpriteFrame Sprite3 = new SpriteFrame(texture, BOOMERANG_POS3_X, BOOMERANG_POS3_Y, BOOMERANG_WIDTH3, BOOMERANG_HEIGHT3);
            SpriteFrame Sprite4 = new SpriteFrame(texture, BOOMERANG_POS4_X, BOOMERANG_POS4_Y, BOOMERANG_WIDTH4, BOOMERANG_HEIGHT4);

            Texture = texture;

            Animation = new Animation();
            Animation.AddFrame(Sprite1, 0 / 8f);
            Animation.AddFrame(Sprite2, 1 / 8f);
            Animation.AddFrame(Sprite3, 2 / 8f);
            Animation.AddFrame(Sprite2, 3 / 8f);
            Animation.AddFrame(Sprite1, 4 / 8f);
            Animation.AddFrame(Sprite4, 5 / 8f);
            Animation.AddFrame(Sprite3, 6 / 8f);
            Animation.AddFrame(Sprite2, 7 / 8f);
            Animation.AddFrame(Sprite1, 8 / 8f);
        }
示例#2
0
 public void AddFrame(SpriteFrame sprite, float timeStamp)
 {
     _frames.Add(new AnimationFrame(sprite, timeStamp));
 }