Exemplo n.º 1
0
        protected void ListMenuItemsSelected(List <string> Items)
        {
            if (Items == null)
            {
                return;
            }

            string Name;

            for (int I = 0; I < Items.Count; I++)
            {
                switch (ItemSelectionChoice)
                {
                case ItemSelectionChoices.Background:
                    Name = Items[I].Substring(0, Items[0].Length - 4).Substring(38);

                    Texture2D NewBackground = BackgroundViewer.content.Load <Texture2D>("Animations/Background Sprites/" + Name);
                    ActiveBackgroundObject.sprBackground  = NewBackground;
                    ActiveBackgroundObject.BackgroundPath = Name;
                    BackgroundViewer.ChangeTexture(NewBackground);
                    break;

                case ItemSelectionChoices.NewLink:
                    Name = Items[I].Substring(0, Items[0].Length - 4).Substring(38);
                    AnimationBackgroundLink NewChain = new AnimationBackgroundLink(Name, BackgroundLinkViewer.content);
                    ActiveBackgroundObject.ListBackgroundLink.Add(NewChain);
                    lstBackgroundChain.Items.Add(NewChain);
                    BackgroundLinkViewer.ChangeTexture(NewChain.sprBackground);
                    break;
                }
            }
        }
Exemplo n.º 2
0
        private void LoadBackgroundObject2D(string AnimationBackgroundPath)
        {
            string Name = AnimationBackgroundPath.Substring(0, AnimationBackgroundPath.Length - 5).Substring(41);

            this.Text = Name + " - Project Eternity Object 2D Editor";

            BackgroundViewer.Preload();
            BackgroundLinkViewer.Preload();

            sprPixel = BackgroundViewer.content.Load <Texture2D>("Pixel");

            FileStream   FS = new FileStream("Content/Animations/Background Objects 2D/" + Name + ".pebo", FileMode.Open, FileAccess.Read);
            BinaryReader BR = new BinaryReader(FS);

            ActiveBackgroundObject = new AnimationBackgroundObject2D(BackgroundViewer.content, BR);

            BackgroundViewer.ChangeTexture(ActiveBackgroundObject.sprBackground);

            foreach (AnimationBackgroundLink ActiveChain in ActiveBackgroundObject.ListBackgroundLink)
            {
                lstBackgroundChain.Items.Add(ActiveChain);
            }

            FS.Close();
            BR.Close();

            BackgroundPreviewViewer.Preload();
            BackgroundPreviewViewer.ActiveAnimationBackground = new AnimationBackground2D(BackgroundPreviewViewer.content, BackgroundPreviewViewer.GraphicsDevice);

            BackgroundPreviewViewer.ActiveAnimationBackground.ListBackground.Add(new AnimationBackground2DImageComplex(ActiveBackgroundObject));
        }
Exemplo n.º 3
0
        private void lstBackgroundChain_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (lstBackgroundChain.SelectedIndex < 0)
            {
                return;
            }

            ActiveBackgroundLink = ActiveBackgroundObject.ListBackgroundLink[lstBackgroundChain.SelectedIndex];
            BackgroundLinkViewer.ChangeTexture(ActiveBackgroundLink.sprBackground);
            pgBackgroundLink.SelectedObject = ActiveBackgroundLink;
        }