예제 #1
0
        public override void Update(Vector2 OFFSET)
        {
            base.Update(OFFSET);
            for (int i = 0; i < toolBtns.Count; i++)
            {
                toolBtns[i].Update(OFFSET);
            }
            int toolIndex = Array.IndexOf(tools, Globals.activeTool);

            if (toolIndex < 0)
            {
                return;
            }
            for (int i = 0; i < toolOptions[toolIndex].Count; i++)
            {
                if (toolOptions[toolIndex][i].GetType() == typeof(Textfield))
                {
                    Textfield textfield = (Textfield)toolOptions[toolIndex][i];
                    switch (textfield.tag)
                    {
                    case "BrushSize":
                        textfield.Update(OFFSET, ref Globals.canvas.BrushSize);
                        break;

                    case "EraserSize":
                        textfield.Update(OFFSET, ref Globals.canvas.EraserSize);
                        break;
                    }
                }
                else
                {
                    toolOptions[toolIndex][i].Update(OFFSET);
                }
            }
        }
예제 #2
0
 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";
     }
 }
예제 #3
0
 public override void Update(Vector2 OFFSET)
 {
     base.Update(OFFSET);
     testBtn.Update(OFFSET);
     testField.Update(OFFSET);
     //testLabel.Update(OFFSET);
     //testLabel.label = "Value: " + testslider.getValue();
     //testslider.Update(OFFSET);
 }
예제 #4
0
        public override void Update(Vector2 OFFSET)
        {
            base.Update(OFFSET);
            while (Frames.Count * 17 + 70 < window.dim.X)
            {
                Frames.Add(new Frame(this, window, timeline));
            }

            for (int i = 0; i < Frames.Count; i++)
            {
                Frames[i].Update(new Vector2(OFFSET.X + i * 17 + 80, OFFSET.Y + layerIndex * 27 + 55));
            }
            nameField.Update(OFFSET);
        }
예제 #5
0
 public override void Update(Vector2 OFFSET)
 {
     if (canvasX.content != "" && int.Parse(canvasX.content) > 1000)
     {
         canvasX.content = "1000";
     }
     if (canvasY.content != "" && int.Parse(canvasY.content) > 1000)
     {
         canvasY.content = "1000";
     }
     base.Update(OFFSET);
     canvasX.Update(OFFSET);
     canvasY.Update(OFFSET);
     cancelBtn.Update(OFFSET);
     OKBtn.Update(OFFSET);
     ProjName.Update(OFFSET);
 }