public void LoadFromFile() { FileStream FS = new FileStream("Content/Animations/" + AnimationPath + ".pea", FileMode.Open, FileAccess.Read); BinaryReader BR = new BinaryReader(FS); LoopStart = BR.ReadInt32(); LoopEnd = BR.ReadInt32(); ScreenWidth = BR.ReadInt32(); ScreenHeight = BR.ReadInt32(); ListAnimationLayer = new AnimationLayerHolder(); int ListAnimationLayerCount = BR.ReadInt32(); for (int L = 0; L < ListAnimationLayerCount; L++) { AnimationLayer NewAnimationLayer = new AnimationLayer(this, ""); NewAnimationLayer.LoadLayer(BR, Content, DicTimeline); ListAnimationLayer.Add(NewAnimationLayer); } GameEngineLayer NewGameEngineLayer = new GameEngineLayer(this); NewGameEngineLayer.LoadLayer(BR, Content, DicTimeline); ListAnimationLayer.EngineLayer = NewGameEngineLayer; FS.Close(); BR.Close(); }
protected void UpdateFrom(AnimationClass Other) { sprTopLeftAttack = Other.sprTopLeftAttack; sprTopLeftCounter = Other.sprTopLeftCounter; sprTopLeftDefense = Other.sprTopLeftDefense; sprTopLeftEvasion = Other.sprTopLeftEvasion; ListAnimationLayer = Other.ListAnimationLayer.Copy(); AnimationPath = Other.AnimationPath; ScreenWidth = Other.ScreenWidth; ScreenHeight = Other.ScreenHeight; LoopStart = Other.LoopStart; LoopEnd = Other.LoopEnd; PolygonEffect = Other.PolygonEffect; }
public AnimationLayerHolder Copy() { AnimationLayerHolder NewAnimationLayerHolder = new AnimationLayerHolder(); NewAnimationLayerHolder.ListAnimationLayer = new List <AnimationLayer>(ListAnimationLayer.Count); foreach (AnimationLayer ActiveLayer in ListAnimationLayer) { NewAnimationLayerHolder.ListAnimationLayer.Add(ActiveLayer.Copy()); } NewAnimationLayerHolder.GameEngineLayer = (GameEngineLayer)GameEngineLayer.Copy(); return(NewAnimationLayerHolder); }
public SceneAnimation() : base(string.Empty) { ListAnimationLayer = new AnimationLayerHolder(); ListAnimationLayer.EngineLayer = GameEngineLayer.EmptyGameEngineLayer(this); }