public DirectionalAnimatedSprite(DirectionalAnimatedSpriteDefinition definition, SpriteInfo spriteInfo) : base(spriteInfo) { _definition = definition; _anims = new AnimatedSprite[16]; for (int i = 0; i < 16; i++) if (_definition[(Direction)i] != null) _anims[i] = new AnimatedSprite(_definition[(Direction)i], SpriteInfo); }
public AnimatedSpriteSpatial(String contentPath, ContentManager contentManager) { if (!_registered.TryGetValue(contentPath, out _record)) _record = Load(contentPath, contentManager); _sprite = _record.Definition.CreateSprite(); _sprite.Scale = _record.InstanceDefaults.Transform.Scale; _sprite.Rotation = _record.InstanceDefaults.Transform.Rotation; _sprite.Opacity = _record.InstanceDefaults.Transform.Opacity; _sprite.Start(); }
public DirectionalAnimationSet(DirectionalAnimationSetDefinition definition) { _definition = definition; _anims = new Dictionary<String, AnimatedSprite[]>(); foreach (String key in _definition.AvailableSets) { _anims[key] = new AnimatedSprite[16]; for (int i = 0; i < 16; i++) { AnimatedSpriteDefinition seqDefinition = _definition[key][(Direction)i]; if (seqDefinition != null) _anims[key][i] = new AnimatedSprite(seqDefinition, SpriteInfo); } } }