Exemplo n.º 1
0
        public ResizeHandles(Layer layer)
        {
            for (int i = 0; i < mHandles.Length; i++)
            {
                mHandles[i] = new LineCircle();
                mHandles[i].Radius = RadiusAtNoZoom;
                ShapeManager.Self.Add(mHandles[i], layer);

            }

            mXLine1 = new Line(null);
            mXLine2 = new Line(null);
            mXLine1.Name = "Resize Handle X Line 1";
            mXLine2.Name = "Resize Handle X Line 2";

            ShapeManager.Self.Add(mXLine1, layer);
            ShapeManager.Self.Add(mXLine2, layer);

            mOriginLine = new Line(null);
            mOriginLine.Name = "Resize Handle Offset Line";
            ShapeManager.Self.Add(mOriginLine, layer);

            Visible = true;
            UpdateToProperties();
        }
        internal static bool TryHandleAsBaseType(string baseType, SystemManagers systemManagers, out IRenderable containedObject)
        {
            bool handledAsBaseType = true;
            containedObject = null;

            switch (baseType)
            {

                case "Container":

                    LineRectangle lineRectangle = new LineRectangle(systemManagers);
                    containedObject = lineRectangle;
                    break;

                case "Rectangle":
                    LineRectangle rectangle = new LineRectangle();
                    rectangle.IsDotted = false;
                    containedObject = rectangle;
                    break;
                case "Circle":
                    LineCircle circle = new LineCircle();
                    circle.CircleOrigin = CircleOrigin.TopLeft;
                    containedObject = circle;
                    break;

                case "ColoredRectangle":
                    SolidRectangle solidRectangle = new SolidRectangle();
                    containedObject = solidRectangle;
                    break;
                case "Sprite":
                    Texture2D texture = null;

                    Sprite sprite = new Sprite(texture);
                    containedObject = sprite;

                    break;
                case "NineSlice":
                    {
                        NineSlice nineSlice = new NineSlice();
                        containedObject = nineSlice;
                    }
                    break;
                case "Text":
                    {
                        Text text = new Text(systemManagers, "");
                        containedObject = text;
                    }
                    break;
                default:
                    handledAsBaseType = false;
                    break;
            }

            return handledAsBaseType;
        }
Exemplo n.º 3
0
        public void Add(LineCircle lineCircle, Layer layer)
        {
            mCircles.Add(lineCircle);

            if (layer == null)
            {
                layer = Renderer.LayersWritable[0];
            }

            layer.Add(lineCircle);
        }
Exemplo n.º 4
0
 public void Remove(LineCircle lineCircle)
 {
     mCircles.Remove(lineCircle);
     Renderer.RemoveRenderable(lineCircle);
 }
Exemplo n.º 5
0
        public void Add(LineCircle lineCircle, Layer layer)
        {
            mCircles.Add(lineCircle);

            if (layer == null)
            {
                layer = Renderer.LayersWritable[0];
            }

            layer.Add(lineCircle);
        }
Exemplo n.º 6
0
 public void Add(LineCircle lineCircle)
 {
     Add(lineCircle, Renderer.LayersWritable[0]);
 }
Exemplo n.º 7
0
        //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 Remove(LineCircle lineCircle)
        {
            mCircles.Remove(lineCircle);
            Renderer.RemoveRenderable(lineCircle);
        }
Exemplo n.º 8
0
 public void Add(LineCircle lineCircle)
 {
     Add(lineCircle, Renderer.LayersWritable[0]);
 }
        public RectangleSelector(SystemManagers managers)
        {
            HandleSize = 4;
            ResetsCursorIfNotOver = true;
            mShowHandles = true;
            mHandles = new List<LineCircle>();
            mLineRectangle = new LineRectangle(managers);

            for (int i = 0; i < 8; i++)
            {
                LineCircle lineCircle = new LineCircle(managers);
                lineCircle.Radius = HandleSize;
                mHandles.Add(lineCircle);
            }

            Width = 34;
            Height = 34;
        }