public void Add(LineGrid lineGrid, Layer layer = null) { if (layer == null) { layer = Renderer.LayersWritable[0]; } mGrids.Add(lineGrid); layer.Add(lineGrid); }
public void Remove(LineGrid lineGrid) { // todo: Need to make this remove from whatever Layer the line rectangle is on mGrids.Remove(lineGrid); Renderer.RemoveRenderable(lineGrid); }
public void Initialize(ImageRegionSelectionControl control, SystemManagers managers, WireframeEditControls wireframeControl) { mManagers = managers; mManagers.Renderer.SamplerState = SamplerState.PointClamp; mControl = control; mManagers.Renderer.Camera.CameraCenterOnScreen = CameraCenterOnScreen.TopLeft; mWireframeControl = wireframeControl; mWireframeControl.WandSelectionChanged += ReactToMagicWandChange; mControl.RegionChanged += new EventHandler(HandleRegionChanged); mControl.MouseWheelZoom += new EventHandler(HandleMouseWheelZoom); mControl.AvailableZoomLevels = mWireframeControl.AvailableZoomLevels; mControl.XnaUpdate += new Action(HandleXnaUpdate); mControl.Panning += HandlePanning; mSpriteOutline = new LineRectangle(managers); managers.ShapeManager.Add(mSpriteOutline); mSpriteOutline.Visible = false; mSpriteOutline.Color = OutlineColor; mLineGrid = new LineGrid(managers); managers.ShapeManager.Add(mLineGrid); mLineGrid.Visible = false; mLineGrid.Color = OutlineColor; mControl.Click += new EventHandler(HandleClick); mStatusText = new StatusTextController(managers); mControl_XnaInitialize(); }