Beispiel #1
0
        private void spriteSheetSplitterBt_Click(object sender, EventArgs e)
        {
            Form form = new Form();

            form.Icon = this.mainForm.Icon;
            form.Text = "Sprite Sheet Splitter";

            SpriteSheetSplitter splitterControl = new SpriteSheetSplitter();

            form.Controls.Add(splitterControl);
            splitterControl.Dock = DockStyle.Fill;

            form.Size        = this.mainForm.Size;
            form.WindowState = this.mainForm.WindowState;
            form.Location    = this.mainForm.Location;

            DialogResult rs = form.ShowDialog(this.mainForm);

            if (rs == DialogResult.OK)
            {
                for (int i = 0; i < splitterControl.Frames.Count; i++)
                {
                    SpriteFrame newFrame = new SpriteFrame(this.sheet.Name, this.sheet.Frames.Count, splitterControl.Frames[i], sheet);
                    this.sheet.Frames.Add(newFrame);
                }

                this.refreshFramesListView();
            }

            splitterControl.Dispose();
            form.Dispose();
            splitterControl = null;
            form            = null;
        }
        private void spriteSheetSplitterBt_Click(object sender, EventArgs e)
        {
            Form form = new Form();
            form.Icon = this.mainForm.Icon;
            form.Text = "Sprite Sheet Splitter";

            SpriteSheetSplitter splitterControl = new SpriteSheetSplitter();
            form.Controls.Add(splitterControl);
            splitterControl.Dock = DockStyle.Fill;

            form.Size = this.mainForm.Size;
            form.WindowState = this.mainForm.WindowState;
            form.Location = this.mainForm.Location;

            DialogResult rs = form.ShowDialog(this.mainForm);

            if (rs == DialogResult.OK)
            {
                for (int i = 0; i < splitterControl.Frames.Count; i++)
                {
                    SpriteFrame newFrame = new SpriteFrame(this.sheet.Name, this.sheet.Frames.Count, splitterControl.Frames[i], sheet);
                    this.sheet.Frames.Add(newFrame);
                }

                this.refreshFramesListView();
            }

            splitterControl.Dispose();
            form.Dispose();
            splitterControl = null;
            form = null;
        }