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(); }
private void LBObjects_SelectedIndexChanged(object sender, EventArgs e) { if (LBObjects.SelectedIndex == -1) { return; } ObjectSetElementData element = Manager.ObjectSet.Elements[LBObjects.SelectedIndex]; TBObjectName.Text = element.ElementName; TBOffsetU.Text = element.OffsetU.ToString(); TBOffsetV.Text = element.OffsetV.ToString(); TBWidth.Text = element.Size.Width.ToString(); TBHeight.Text = element.Size.Height.ToString(); SurfaceObject.DrawingRectangle = new Rectangle(element.OffsetU, element.OffsetV, element.Size.Width, element.Size.Height); SurfaceObject.Invalidate(); }
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); } } }