Exemplo n.º 1
0
        private void button4_Click(object sender, EventArgs e)
        {
            nbHarry  = 6;
            nbFrames = 0;
            InitDurationAndRecord();
            LstFrame.Clear();
            pack = Pack.BuildPack(6, Convert.ToInt32(nudBig.Value), 305, Convert.ToInt32(numericUpDown2.Value));

            g.Clear(SystemColors.Control);
            pack.Draw(g);
            timer1.Enabled = true;
        }
Exemplo n.º 2
0
        private void timer1_Tick(object sender, EventArgs e)
        {
            if (pack != null)
            {
                g.Clear(SystemColors.Control);
                pack.Draw(g);
                pack.Animate();
                //on transmet les infos aux autres applications

                string sfrmXml = pack.GetFormattedPack();
                if (nbFrames > 0)
                {
                    LstFrame.Add(sfrmXml);
                }

                //AM pack.ProcessXY(100, 100);
                //AM pack.CheckCollison();
                //AM if (checkBox1.Checked) pack.PreventCollision();

                label_Chrono.Text = ((nbMaxframes - nbFrames) / 25).ToString();
                nbFrames++;
                if (nbFrames > nbMaxframes)
                {
                    timer1.Enabled = false;
                    if (bGenerateFile == false)
                    {
                        return;
                    }

                    string fileName = "\\fichiers\\TabXml\\Tab_Harry" + nbHarry + "v" + Convert.ToString(nudManche.Value) + "Big" + Convert.ToString(nudBig.Value) + ".xml";
                    if (MessageBox.Show("save " + fileName + " ?", "record ?", MessageBoxButtons.YesNo) == DialogResult.Yes)
                    {
                        using (StreamWriter writer = new StreamWriter(Application.StartupPath + fileName))
                        {
                            writer.WriteLine("<root>");
                            writer.WriteLine("<Keyframes>");

                            int i = 0;
                            foreach (string s in LstFrame)
                            {
                                char c = Convert.ToChar(0x22); //la double cote
                                writer.WriteLine("<Keyframe pos=" + c + i + c + ">");
                                writer.WriteLine(s);
                                writer.WriteLine("</Keyframe>");
                                i++;
                            }
                            writer.WriteLine("</Keyframes>");
                            writer.WriteLine("</root>");
                        }
                    }
                }
            }
        }
Exemplo n.º 3
0
        private void button4_Click(object sender, EventArgs e)
        {
            nbHarry = 6;
            nbFrames = 0;
            InitDurationAndRecord();
            LstFrame.Clear();
            pack = Pack.BuildPack(6, Convert.ToInt32(nudBig.Value), 305, Convert.ToInt32(numericUpDown2.Value));

            g.Clear(SystemColors.Control);
            pack.Draw(g);
            timer1.Enabled = true;
        }