public Simulator(DevicePanel Graphics) { InitializeComponent(); Controls.Add(Graphics); this.Graphics = Graphics; Graphics.OnRender += new RenderEventHandler(Graphics_OnRender); Graphics.MouseMove += new MouseEventHandler(Graphics_MouseMove); Graphics.MouseWheel += new MouseEventHandler(Graphics_MouseWheel); Graphics.MouseDoubleClick += new MouseEventHandler(Graphics_MouseDoubleClick); Graphics.MouseDown += new MouseEventHandler(Graphics_MouseDown); Graphics.OnCreateDevice += new CreateDeviceEventHandler(Graphics_OnCreateDevice); Graphics.MouseUp += new MouseEventHandler(Graphics_MouseUp); Graphics.KeyDown += new KeyEventHandler(Graphics_KeyDown); Graphics.KeyUp += new KeyEventHandler(Graphics_KeyUp); //Graphics.Size = new Size(800, 600); MapEditor.Instance.Width = 800; MapEditor.Instance.Height = 600; Graphics.Focus(); if (MapEditor.Instance.ShiftX < Map.Instance.VRLeft + Map.Instance.CenterX) MapEditor.Instance.ShiftX = Map.Instance.VRLeft + Map.Instance.CenterX; if (MapEditor.Instance.ShiftX + 800 > Map.Instance.VRRight + Map.Instance.CenterX) MapEditor.Instance.ShiftX = Map.Instance.VRRight + Map.Instance.CenterX - 800; if (MapEditor.Instance.ShiftY < Map.Instance.VRTop + Map.Instance.CenterY) MapEditor.Instance.ShiftY = Map.Instance.VRTop + Map.Instance.CenterY; if (MapEditor.Instance.ShiftY + 600 > Map.Instance.VRBottom + Map.Instance.CenterY) MapEditor.Instance.ShiftY = Map.Instance.VRBottom + Map.Instance.CenterY - 600; physics = new MaplePyhsics(MapEditor.file.Directory.GetIMG("Physics.img"), 0, 0); }
public Simulator(DevicePanel Graphics) { InitializeComponent(); Controls.Add(Graphics); this.Graphics = Graphics; Graphics.OnRender += new RenderEventHandler(Graphics_OnRender); Graphics.MouseMove += new MouseEventHandler(Graphics_MouseMove); Graphics.MouseWheel += new MouseEventHandler(Graphics_MouseWheel); Graphics.MouseDoubleClick += new MouseEventHandler(Graphics_MouseDoubleClick); Graphics.MouseDown += new MouseEventHandler(Graphics_MouseDown); Graphics.OnCreateDevice += new CreateDeviceEventHandler(Graphics_OnCreateDevice); Graphics.MouseUp += new MouseEventHandler(Graphics_MouseUp); Graphics.KeyDown += new KeyEventHandler(Graphics_KeyDown); Graphics.KeyUp += new KeyEventHandler(Graphics_KeyUp); //Graphics.Size = new Size(800, 600); MapEditor.Instance.Width = 800; MapEditor.Instance.Height = 600; Graphics.Focus(); if (MapEditor.Instance.ShiftX < Map.Instance.VRLeft + Map.Instance.CenterX) { MapEditor.Instance.ShiftX = Map.Instance.VRLeft + Map.Instance.CenterX; } if (MapEditor.Instance.ShiftX + 800 > Map.Instance.VRRight + Map.Instance.CenterX) { MapEditor.Instance.ShiftX = Map.Instance.VRRight + Map.Instance.CenterX - 800; } if (MapEditor.Instance.ShiftY < Map.Instance.VRTop + Map.Instance.CenterY) { MapEditor.Instance.ShiftY = Map.Instance.VRTop + Map.Instance.CenterY; } if (MapEditor.Instance.ShiftY + 600 > Map.Instance.VRBottom + Map.Instance.CenterY) { MapEditor.Instance.ShiftY = Map.Instance.VRBottom + Map.Instance.CenterY - 600; } physics = new MaplePyhsics(MapEditor.file.Directory.GetIMG("Physics.img"), 0, 0); }