Storyboard animations not working in demo.advanced

Mar 7, 2013 at 12:02 PM
Hi Andy,

Ik was trying to get an animation to work but it never did anything. The storyboard runs but nothing happens so i looked ad demo.advanced for help but then i noticed the eyes of the smiley wont move either.

Do you have a suggestion, i also tried changing the target property using a fully qualified name but nothing happend.
Mar 7, 2013 at 12:18 PM

Yes there is an issue if you are targeting Windows 8 and using Storboard animations. You need to disable Cachemode="BitmapCache" on any sprites that use animations (otherwise the runtime will just ignore animations because the visual element is cached).

The CacheMode is set in PhysicsSprite.cs:
        this.CacheMode = new BitmapCache();
So you can either comment that line out for Windows 8, or you could probably just set the CacheMode to null on the Sprite that has animation.

Hope this helps.
Mar 7, 2013 at 1:24 PM
Hi Andy,

Thanks for the quick reply, youre suggestion solved the problem, I added another enum to the PhysicsSprite a la ShapeTypes ;)
        public enum CachingModes

        private CachingModes _cachingMode;
        public string CachingMode
                return _cachingMode.ToString();
                _cachingMode = (CachingModes)Enum.Parse(typeof(CachingModes), value, true);
                if (_cachingMode.Equals(CachingModes.BitmapCache)) { this.CacheMode = new BitmapCache(); }
                else { this.CacheMode = null; };