Пример #1
0
        public override void Initialize(GameScreen parentScreen)
        {
            base.Initialize(parentScreen);

            // Load the clip. Note that this instance is shared with all
            // entities that want this clip file.
            Clip clip = parentScreen.Content.Load <Clip>(Settings.ClipFile);

            clip.Init(parentScreen.Content);

            // Create the ClipInstance. This allows different entities to
            // share the same clip and play their own animations on it
            ClipInstance = new ClipInstance(clip);
            //ClipInstance.Scale = new Vector2(-1.0f, 1.0f);

            // Set the initial position of the clip instance
            Position = Settings.Position;
            Origin   = Settings.Origin;
            Rotation = MathHelper.ToRadians(Settings.Rotation);
            Scale    = Settings.Scale;
            FlipX    = Settings.FlipX;
            FlipY    = Settings.FlipY;

            if (string.IsNullOrEmpty(Settings.DefaultAnimName))
            {
                ClipInstance.Play(clip.AnimSet.Anims[0], Settings.DefaultAnimLooping);
            }
            else
            {
                ClipInstance.Play(Settings.DefaultAnimName, Settings.DefaultAnimLooping);
            }
            ClipInstance.Update(Settings.DefaultAnimOffset);
        }
Пример #2
0
 public override void Update(GameTime gameTime)
 {
     ClipInstance.Update((float)gameTime.ElapsedGameTime.TotalSeconds);
 }
Пример #3
0
 public override void Update(float dt)
 {
     ClipInstance.Update(dt);
 }