Beispiel #1
0
        private void 새로만들기ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            NewObjectSet new_object_set = new NewObjectSet(KAssetDir);

            new_object_set.ShowDialog();

            if (new_object_set.DialogResult == DialogResult.OK)
            {
                Manager.CreateNewObjectSet(
                    new_object_set.Controls["tbObjectSetName"].Text,
                    new_object_set.Controls["tbTextureFileName"].Text);

                this.Text = "DirectX11Tutorial Object Editor: " + Manager.ObjectSet.ObjectSetName;

                SurfaceTexture.ClearTextures();
                SurfaceTexture.AddTextureFromFile(Manager.ObjectSet.TextureFileName);

                SurfaceObject.ClearTextures();
                SurfaceObject.AddTextureFromFile(Manager.ObjectSet.TextureFileName);

                SurfaceTexture.Invalidate();
                SurfaceObject.Invalidate();

                LBObjects.Items.Clear();
            }

            new_object_set.Dispose();
        }
Beispiel #2
0
        private void 불러오기ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            DlgOpen.InitialDirectory = KAssetDir;
            DlgOpen.Filter           = "오브젝트 셋 파일 (*.xml)|*.xml";
            DlgOpen.DefaultExt       = ".xml";
            DlgOpen.FileName         = "";
            DlgOpen.Title            = "오브젝트 셋 불러오기";

            if (DlgOpen.ShowDialog() == DialogResult.OK)
            {
                Manager.LoadFromFile(DlgOpen.FileName);

                this.Text = "DirectX11Tutorial Object Editor: " + Manager.ObjectSet.ObjectSetName;

                SurfaceTexture.ClearTextures();
                SurfaceTexture.AddTextureFromFile(Manager.ObjectSet.TextureFileName);

                SurfaceObject.ClearTextures();
                SurfaceObject.AddTextureFromFile(Manager.ObjectSet.TextureFileName);

                SurfaceTexture.Invalidate();
                SurfaceObject.Invalidate();

                SSize texture_size = SurfaceTexture.GetTextureSize(0);

                hScrollBar1.LargeChange = KScrollDelta;
                hScrollBar1.Maximum     = texture_size.Width / hScrollBar1.LargeChange;

                vScrollBar1.LargeChange = KScrollDelta;
                vScrollBar1.Maximum     = texture_size.Height / vScrollBar1.LargeChange;

                LBObjects.Items.Clear();
                foreach (ObjectSetElementData element in Manager.ObjectSet.Elements)
                {
                    LBObjects.Items.Add(element.ElementName);
                }
            }
        }