Exemplo n.º 1
0
        private void pnl_stickFigureColorImg_Click(object sender, EventArgs e)
        {
            if (Program.MainTimeline.SelectedKeyframe == null)
            {
                return;
            }
            if (Program.MainTimeline.SelectedKeyframe.State.GetType() != typeof(StickFigure.State))
            {
                return;
            }

            StickFigure.State state = Program.MainTimeline.SelectedKeyframe.State as StickFigure.State;

            ColorPickerDialog dlg = new ColorPickerDialog();

            dlg.StartPosition = FormStartPosition.CenterParent;

            if (dlg.ShowDialog() == DialogResult.OK)
            {
                pnl_stickFigureColorImg.BackColor = dlg.Color;
                lbl_stickFigureColorNumbers.Text  = string.Format("{0}, {1}, {2}", dlg.Color.R, dlg.Color.G, dlg.Color.B);
            }

            state.Root.SetColor(dlg.Color, null);

            Program.MainTimeline.GLContext.Invalidate();
        }
Exemplo n.º 2
0
        public StickEditorForm(StickFigure Figure, StickFigure.State State)
        {
            InitContext();

            FromProperties = true;

            ActiveFigure      = Figure;
            ActiveFigureState = State;
        }
Exemplo n.º 3
0
        private void btn_openStickEditor_Click(object sender, EventArgs e)
        {
            StickEditorForm f = new StickEditorForm();

            if (f.ShowDialog() == DialogResult.OK)
            {
                txt_customFigPath.Text = "Custom figure created with Editor";

                CustomFigure      = f.CreatedFigure;
                CustomFigureState = f.CreatedFigureState;
            }
        }
Exemplo n.º 4
0
        public void ProjectOpen(string filename)
        {
            ActiveFigure = new StickFigure();

            using (var reader = new BinaryReader(new FileStream(filename, FileMode.Open)))
            {
                UInt16 version = reader.ReadUInt16();
                ActiveFigure.Read(reader, version);
                reader.Close();
            }

            ActiveFigureState = (StickFigure.State)ActiveFigure.CreateRefState();

            UpdateSelection();

            GLContext.Invalidate();
        }
Exemplo n.º 5
0
        private void cmb_stickBitmaps_SelectionChangeCommitted(object sender, EventArgs e)
        {
            if (Program.MainTimeline.SelectedFrameset == null)
            {
                return;
            }
            if (Program.MainTimeline.SelectedLayer.Data.GetType() != typeof(CustomFigure))
            {
                return;
            }

            StickFigure.State       state      = Program.MainTimeline.SelectedKeyframe.State as StickFigure.State;
            StickFigure.Joint.State jointState = state.Root.FindState((StickFigure.Joint.State)Program.Form_Canvas.LastDragObject);

            jointState.BitmapIndex = cmb_stickBitmaps.SelectedIndex - 1;

            Program.MainTimeline.GLContext.Invalidate();
        }
Exemplo n.º 6
0
        private void StickEditorForm_Load(object sender, EventArgs e)
        {
            GLContext_Init();

            if (!FromProperties)
            {
                ActiveFigure = new StickFigure();
                SelectedPair = null;

                int ID = 0;

                ActiveFigure.Root          = new StickFigure.Joint();
                ActiveFigure.Root.Location = new PointF(250, 300);
                var next = StickFigure.Joint.RelativeTo(ActiveFigure.Root, new PointF(0, -50));

                ActiveFigureState = (StickFigure.State)ActiveFigure.CreateRefState();
            }

            UpdateSelection();
        }
Exemplo n.º 7
0
        private void btn_customFigBrowse_Click(object sender, EventArgs e)
        {
            OpenFileDialog dlg = new OpenFileDialog();

            dlg.Title  = "Open an Existing Custom Figure";
            dlg.Filter = "TISFAT Zero Figures|*.tzf";

            if (dlg.ShowDialog() == DialogResult.OK)
            {
                txt_customFigPath.Text = dlg.FileName;

                CustomFigure = new StickFigure();

                using (var reader = new BinaryReader(new FileStream(dlg.FileName, FileMode.Open)))
                {
                    UInt16 version = reader.ReadUInt16();
                    CustomFigure.Read(reader, version);
                    reader.Close();
                }

                CustomFigureState = (StickFigure.State)CustomFigure.CreateRefState();
            }
        }
Exemplo n.º 8
0
        private void btn_customFigBrowse_Click(object sender, EventArgs e)
        {
            OpenFileDialog dlg = new OpenFileDialog();

            dlg.Title = "Open an Existing Custom Figure";
            dlg.Filter = "TISFAT Zero Figures|*.tzf";

            if (dlg.ShowDialog() == DialogResult.OK)
            {
                txt_customFigPath.Text = dlg.FileName;

                CustomFigure = new StickFigure();

                using (var reader = new BinaryReader(new FileStream(dlg.FileName, FileMode.Open)))
                {
                    UInt16 version = reader.ReadUInt16();
                    CustomFigure.Read(reader, version);
                    reader.Close();
                }

                CustomFigureState = (StickFigure.State)CustomFigure.CreateRefState();
            }
        }
Exemplo n.º 9
0
        private void btn_openStickEditor_Click(object sender, EventArgs e)
        {
            StickEditorForm f = new StickEditorForm();

            if(f.ShowDialog() == DialogResult.OK)
            {
                txt_customFigPath.Text = "Custom figure created with Editor";

                CustomFigure = f.CreatedFigure;
                CustomFigureState = f.CreatedFigureState;
            }
        }