Inheritance: IRenderableIpso, IVisible
Exemplo n.º 1
0
        public void Remove(Text text)
        {
            mTexts.Remove(text);
#if !TEST
            Renderer.RemoveRenderable(text);
#endif
        }
Exemplo n.º 2
0
        public StatusTextController(SystemManagers systemManagers)
        {
            mManagers = systemManagers;
            mText = new Text(systemManagers, "Unset Text");
            mText.RenderBoundary = false;
            systemManagers.TextManager.Add(mText);

            UpdateText();
        }
Exemplo n.º 3
0
        public void Add(Text text, Layer layer)
        {
            if (layer == null)
            {
                layer = Renderer.LayersWritable[0];
            }
            mTexts.Add(text);
#if !TEST
            layer.Add(text);
#endif
        }
        public TilePropertyHighlight(SystemManagers managers)
        {
            Children = new List<IRenderableIpso>();
            mManagers = managers;
            mLineRectangle = new LineRectangle(mManagers);
            mLineRectangle.Width = 16;
            mLineRectangle.Height = 16;
            mLineRectangle.Z = 1;
            mLineRectangle.Parent = this;

            mLineRectangle.Color = new Microsoft.Xna.Framework.Color(1, 1, 1, .3f);

            mCountDisplay = new Text(mManagers, "99");
            mCountDisplay.HorizontalAlignment = HorizontalAlignment.Left;
            mCountDisplay.VerticalAlignment = VerticalAlignment.Top;
            mCountDisplay.Z = 1;
            mCountDisplay.Parent = this;
        }
        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;
        }
 private static void SetAlphaAndColorValues(Text text, RecursiveVariableFinder rvf)
 {
     Microsoft.Xna.Framework.Color color = ColorFromRvf(rvf);
     text.Red = color.R;
     text.Green = color.G;
     text.Blue = color.B;
     text.Alpha = color.A;  //Is alpha supported?
 }
 private static void SetAlignmentValues(Text text, RecursiveVariableFinder rvf)
 {
     //Could these potentially be out of bounds?
     text.HorizontalAlignment = rvf.GetValue<HorizontalAlignment>("HorizontalAlignment");
     text.VerticalAlignment = rvf.GetValue<VerticalAlignment>("VerticalAlignment");
 }
Exemplo n.º 8
0
 private void CreateGuideText()
 {
     mGrabbedGuideText = new Text(mManagers, "");
     mGrabbedGuideText.RenderBoundary = false;
     mGrabbedGuideText.Parent = mOffsetSprite;
     TextManager.Add(mGrabbedGuideText, mLayer);
 }
Exemplo n.º 9
0
 public void Add(Text text)
 {
     Add(text, null);
 }