상속: IPositionedSizedObject, IRenderable, IVisible
예제 #1
0
        public void Add(SolidRectangle solidRectangle, Layer layer = null)
        {
            if (layer == null)
            {
                layer = Renderer.LayersWritable[0];
            }

            mSolidRectangles.Add(solidRectangle);
            layer.Add(solidRectangle);
        }
        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;
        }
예제 #3
0
 public void Remove(SolidRectangle solidRectangle)
 {
     mSolidRectangles.Remove(solidRectangle);
     Renderer.RemoveRenderable(solidRectangle);
 }
 private static void SetAlphaAndColorValues(SolidRectangle solidRectangle, RecursiveVariableFinder rvf)
 {
     solidRectangle.Color = ColorFromRvf(rvf);
 }
예제 #5
0
파일: Ruler.cs 프로젝트: jiailiuyan/Gum
        private void CreateVisualRepresentation()
        {
            mOffsetSprite = new Sprite(null);

            mRectangle = new SolidRectangle();
            mRectangle.Color = Color.Yellow;
            ShapeManager.Add(mRectangle, mLayer);

            ReactToRulerSides();

            CreateRulerLines();
        }