Exemplo n.º 1
0
        private void editToolStripMenuItem2_Click(object sender, EventArgs e)
        {
            SpriteSheet s = (SpriteSheet)projectTree.SelectedNode.Tag;

            using (SpriteSheetDialog ssd = new SpriteSheetDialog(main.Project, s))
            {
                if (ssd.ShowDialog() == System.Windows.Forms.DialogResult.OK)
                {
                    projectTree.SelectedNode.Text = ssd.SpriteSheetName;
                    s.Name             = ssd.SpriteSheetName;
                    main.Project.Saved = false;
                }
            }
        }
Exemplo n.º 2
0
        private void spriteSheetToolStripMenuItem_Click(object sender, EventArgs e)
        {
            SpriteSheet s = new SpriteSheet();

            using (SpriteSheetDialog ssd = new SpriteSheetDialog(main.Project, s))
            {
                if (ssd.ShowDialog() == System.Windows.Forms.DialogResult.OK)
                {
                    TreeNode node = new TreeNode(ssd.SpriteSheetName);
                    node.Name             = "SpriteSheetNode";
                    node.SelectedImageKey = node.ImageKey = "spritesheets.png";

                    TreeNode spritesNode = new TreeNode("Sprites");
                    spritesNode.Name             = "SpritesNode";
                    spritesNode.SelectedImageKey = spritesNode.ImageKey = "sprites.png";

                    TreeNode animationsNode = new TreeNode("Animations");
                    animationsNode.Name             = "AnimationsNode";
                    animationsNode.SelectedImageKey = animationsNode.ImageKey = "anims.png";


                    node.Nodes.Add(spritesNode);
                    node.Nodes.Add(animationsNode);

                    s.Name   = ssd.SpriteSheetName;
                    node.Tag = s;

                    spritesNode.Tag    = node.Tag;
                    animationsNode.Tag = node.Tag;

                    if (SpriteSheetAdded != null)
                    {
                        SpriteSheetAdded(this, (SpriteSheet)node.Tag);
                    }

                    this.projectTree.SelectedNode.Nodes.Add(node);
                    main.Project.Saved = false;
                }
            }
        }