public EditMapForm() { EditMap = new InvaderEng.Map.Map(); EditMap.WallBox(0, 0, 100, 30); Edit = new MapForm(); Edit.Map = EditMap; //this.body.Add(Edit); //body.Add(IMG); //RenderMap(); SubChanged = () => { // FB = new FrameBufferColor(W - 10, H - 80); Edit.Set(5, 30, body.W - 10, body.H - 40); //IMG.SetImage(FB.BB); if (!body.Forms.Contains(Edit)) { body.Add(Edit); } Edit.MouseDown = (b) => { Root.Forms.Remove(this); Root.Forms.Add(this); }; //RenderMap(); }; }
public override void InitState() { base.InitState(); SUI = new UI(); var bg = new ImageForm().Set(0, 0, AppInfo.W, AppInfo.H).SetImage(new Texture2D("FoomED/bg2.jpg", LoadMethod.Single, false)); SUI.Root.Add(bg); var edit_win = new Forms.EditMapForm().Set(30, 200, AppInfo.W - 80, AppInfo.H - 250, "Edit:" + MapName) as Forms.EditMapForm; bg.Add(edit_win); var tool_win = new WindowForm().Set(30, 10, 600, 120, "Tools"); bg.Add(tool_win); CurMap = new InvaderEng.Map.Map(); CurMap.WallBox(0, 0, 200, 30); edit_win.EditMap = CurMap; edit_win.RenderMap(); var mapRen = new Forms.MapRenderForm().Set(300, 80, 512, 512, "Map Preview") as Forms.MapRenderForm; mapRen.Map = edit_win.EditMap; mapRen.Render = new InvaderEng.Render.MapRenderer(); mapRen.Render.Map = mapRen.Map; bg.Add(mapRen); }