public override void Update(Vector2 OFFSET) { //access to TimelineWindow if (timelineWindow == null) { timelineWindow = (TimelineWindow)ObjManager.Windows.Find(x => x.GetType().Name == "TimelineWindow"); if (timelineWindow != null) { timelineWindow.pbWindow = this; } } else { if (timer.Test() && playing && fpsTxt.content != "0") { //play animation if (timelineWindow.timeline.currentFrame < endFrame) { timelineWindow.timeline.nextFrame(); } //start playing again else { back(); } timer.ResetToZero(); if (fpsTxt.content == "") { timer.Ms = 1000; } else { timer.Ms = 1000 / int.Parse(fpsTxt.content); } } timer.UpdateTimer(); } base.Update(OFFSET); playBtn.Update(OFFSET); backBtn.Update(OFFSET); fpsTxt.Update(OFFSET); startFrameTxt.Update(OFFSET); endFrameTxt.Update(OFFSET); if (startFrameTxt.content != "") { startFrame = int.Parse(startFrameTxt.content); } else { startFrame = 0; } if (endFrameTxt.content != "") { endFrame = int.Parse(endFrameTxt.content); } if (endFrame > 20) { endFrame = 20; endFrameTxt.content = "20"; } }
void OK() { TimelineWindow timelineWindow = (TimelineWindow)ObjManager.Windows.Find(x => x.GetType().Name == "TimelineWindow"); if (timelineWindow != null) { timelineWindow.timeline.Layers = new List <Layer>(); } for (int i = 0; i < ObjManager.Windows.Count; i++) { ObjManager.Windows[i].delete = true; } Window canvasWindow = new CanvasWindow(new Vector2(50, 50), new Vector2(400, 400)); //we need a fresh canvas Globals.canvas = new Canvas(canvasWindow, new Vector2(20, 35), new Vector2(int.Parse(canvasX.content), int.Parse(canvasY.content))); Globals.canvas.cp = null; Globals.canvas.timelineWindow = null; Globals.PassWindow(canvasWindow); ObjManager.projName = ProjName.content; Globals.interactWindow = null; }