Example #1
0
        public LineRectangle(SystemManagers managers)
        {
            LocalVisible = true;

            mManagers = managers;

            mChildren = new ObservableCollection <IRenderableIpso>();

            Visible = true;
            Renderer renderer = null;

            if (mManagers != null)
            {
                renderer = mManagers.Renderer;
            }
            else
            {
                renderer = Renderer.Self;
            }
            mLinePrimitive = new LinePrimitive(renderer.SinglePixelTexture);
            mLinePrimitive.Add(0, 0);
            mLinePrimitive.Add(0, 0);
            mLinePrimitive.Add(0, 0);
            mLinePrimitive.Add(0, 0);
            mLinePrimitive.Add(0, 0);

            UpdatePoints();

            IsDotted = true;
        }
Example #2
0
        public LineRectangle(SystemManagers managers)
        {
            LocalVisible = true;

            mManagers = managers;

            mChildren = new List<IPositionedSizedObject>();

            Visible = true;
            Renderer renderer = null;
            if (mManagers != null)
            {
                renderer = mManagers.Renderer;
            }
            else
            {
                renderer = Renderer.Self;
            }
            mLinePrimitive = new LinePrimitive(renderer.SinglePixelTexture);
            mLinePrimitive.Add(0, 0);
            mLinePrimitive.Add(0, 0);
            mLinePrimitive.Add(0, 0);
            mLinePrimitive.Add(0, 0);
            mLinePrimitive.Add(0, 0);

            UpdatePoints();

            IsDotted = true;
        }
Example #3
0
        public LineRectangle(SystemManagers managers)
        {
            LocalVisible = true;

            mManagers = managers;

            mChildren = new List <IPositionedSizedObject>();

            Visible = true;
            Renderer renderer = null;

            if (mManagers != null)
            {
                renderer = mManagers.Renderer;
            }
            else
            {
                renderer = Renderer.Self;
            }
            mLinePrimitive = new LinePrimitive(renderer.SinglePixelTexture);
            mLinePrimitive.Add(0, 0);
            mLinePrimitive.Add(0, 0);
            mLinePrimitive.Add(0, 0);
            mLinePrimitive.Add(0, 0);
            mLinePrimitive.Add(0, 0);

            UpdatePoints();

            IsDotted = true;
        }
Example #4
0
        public static void RenderLinePrimitive(LinePrimitive linePrimitive, SpriteBatch spriteBatch, IPositionedSizedObject ipso, SystemManagers managers, bool isDotted)
        {
            linePrimitive.Position.X = ipso.GetAbsoluteX();
            linePrimitive.Position.Y = ipso.GetAbsoluteY();

            Renderer renderer;

            if (managers != null)
            {
                renderer = managers.Renderer;
            }
            else
            {
                renderer = Renderer.Self;
            }

            Texture2D textureToUse = renderer.SinglePixelTexture;

            if (isDotted)
            {
                textureToUse = renderer.DottedLineTexture;
            }

            linePrimitive.Render(spriteBatch, managers, textureToUse, .2f * renderer.Camera.Zoom);
        }
Example #5
0
 public static void UpdateLinePrimitive(LinePrimitive linePrimitive, IPositionedSizedObject ipso)
 {
     linePrimitive.Replace(0, Vector2.Zero);
     linePrimitive.Replace(1, new Vector2(ipso.Width, 0));
     linePrimitive.Replace(2, new Vector2(ipso.Width, ipso.Height));
     linePrimitive.Replace(3, new Vector2(0, ipso.Height));
     linePrimitive.Replace(4, Vector2.Zero); // close back on itself
 }
Example #6
0
        public static void UpdateLinePrimitive(LinePrimitive linePrimitive, IRenderableIpso ipso)
        {
            Matrix matrix = Matrix.CreateRotationZ(-MathHelper.ToRadians(ipso.GetAbsoluteRotation()));

            linePrimitive.Replace(0, Vector2.Zero);
            linePrimitive.Replace(1, Vector2.Transform(new Vector2(ipso.Width, 0), matrix));
            linePrimitive.Replace(2, Vector2.Transform(new Vector2(ipso.Width, ipso.Height), matrix));
            linePrimitive.Replace(3, Vector2.Transform(new Vector2(0, ipso.Height), matrix));
            linePrimitive.Replace(4, Vector2.Zero); // close back on itself
        }
Example #7
0
        public static void UpdateLinePrimitive(LinePrimitive linePrimitive, IPositionedSizedObject ipso)
        {
            Matrix matrix = Matrix.CreateRotationZ(-MathHelper.ToRadians(ipso.Rotation));



            linePrimitive.Replace(0, Vector2.Zero);
            linePrimitive.Replace(1, Vector2.Transform(new Vector2(ipso.Width, 0), matrix));
            linePrimitive.Replace(2, Vector2.Transform(new Vector2(ipso.Width, ipso.Height), matrix));
            linePrimitive.Replace(3, Vector2.Transform(new Vector2(0, ipso.Height), matrix));
            linePrimitive.Replace(4, Vector2.Zero); // close back on itself
        }
Example #8
0
        public LineGrid(SystemManagers managers)
        {
            Visible = true;
            if (managers != null)
            {
                mLinePrimitive = new LinePrimitive(managers.Renderer.SinglePixelTexture);
            }
            else
            {
                mLinePrimitive = new LinePrimitive(Renderer.Self.SinglePixelTexture);
            }

            mLinePrimitive.BreakIntoSegments = true;

            UpdatePoints();
        }
        public LineGrid(SystemManagers managers)
        {
            Visible = true;
            if (managers != null)
            {
                mLinePrimitive = new LinePrimitive(managers.Renderer.SinglePixelTexture);
            }
            else
            {
                mLinePrimitive = new LinePrimitive(Renderer.Self.SinglePixelTexture);
            }

            mLinePrimitive.BreakIntoSegments = true;

            UpdatePoints();
        }
Example #10
0
        public LineCircle(SystemManagers managers)
        {
            mRadius = 32;
            Visible = true;

            if (managers != null)
            {
                mLinePrimitive = new LinePrimitive(managers.Renderer.SinglePixelTexture);
            }
            else
            {
                mLinePrimitive = new LinePrimitive(Renderer.Self.SinglePixelTexture);
            }

            UpdatePoints();
        }
Example #11
0
        public Line(SystemManagers managers)
        {
            mManagers = managers;

            Visible = true;
            if (mManagers != null)
            {
                mLinePrimitive = new LinePrimitive(mManagers.Renderer.SinglePixelTexture);
            }
            else
            {
                mLinePrimitive = new LinePrimitive(Renderer.Self.SinglePixelTexture);
            }

            mChildren = new List<IPositionedSizedObject>();
            UpdatePoints();
        }
Example #12
0
        public LinePolygon(SystemManagers managers)
        {
            mChildren = new ObservableCollection <IRenderableIpso>();

            Visible = true;

            if (managers != null)
            {
                mLinePrimitive = new LinePrimitive(managers.Renderer.SinglePixelTexture);
            }
            else
            {
                mLinePrimitive = new LinePrimitive(Renderer.Self.SinglePixelTexture);
            }

            // todo - make it default to something - a rectangle?
        }
Example #13
0
        public Line(SystemManagers managers)
        {
            mManagers = managers;

            Visible = true;
            if (mManagers != null)
            {
                mLinePrimitive = new LinePrimitive(mManagers.Renderer.SinglePixelTexture);
            }
            else
            {
                mLinePrimitive = new LinePrimitive(Renderer.Self.SinglePixelTexture);
            }

            mChildren = new List <IRenderableIpso>();
            UpdatePoints();
        }
Example #14
0
        public LineCircle(SystemManagers managers)
        {
            mChildren = new List <IPositionedSizedObject>();

            mRadius = 32;
            Visible = true;

            if (managers != null)
            {
                mLinePrimitive = new LinePrimitive(managers.Renderer.SinglePixelTexture);
            }
            else
            {
                mLinePrimitive = new LinePrimitive(Renderer.Self.SinglePixelTexture);
            }

            UpdatePoints();
        }
Example #15
0
        public LineCircle(SystemManagers managers)
        {
            mChildren = new ObservableCollection <IRenderableIpso>();

            mRadius = 32;
            Visible = true;

            if (managers != null)
            {
                mLinePrimitive = new LinePrimitive(managers.Renderer.SinglePixelTexture);
            }
            else
            {
                mLinePrimitive = new LinePrimitive(Renderer.Self.SinglePixelTexture);
            }

            UpdatePoints();
        }
Example #16
0
 public static void UpdateLinePrimitive(LinePrimitive linePrimitive, IPositionedSizedObject ipso)
 {
     linePrimitive.Replace(0, Vector2.Zero);
     linePrimitive.Replace(1, new Vector2(ipso.Width, 0));
     linePrimitive.Replace(2, new Vector2(ipso.Width, ipso.Height));
     linePrimitive.Replace(3, new Vector2(0, ipso.Height));
     linePrimitive.Replace(4, Vector2.Zero); // close back on itself
 }
Example #17
0
        public static void RenderLinePrimitive(LinePrimitive linePrimitive, SpriteBatch spriteBatch, IPositionedSizedObject ipso, SystemManagers managers, bool isDotted)
        {
            linePrimitive.Position.X = ipso.GetAbsoluteX();
            linePrimitive.Position.Y = ipso.GetAbsoluteY();

            Renderer renderer;
            if (managers != null)
            {
                renderer = managers.Renderer;
            }
            else
            {
                renderer = Renderer.Self;
            }

            Texture2D textureToUse = renderer.SinglePixelTexture;

            if (isDotted)
            {
                textureToUse = renderer.DottedLineTexture;
            }

            linePrimitive.Render(spriteBatch, managers, textureToUse, .2f * renderer.Camera.Zoom);
        }
Example #18
0
        public Text(SystemManagers managers, string text = "Hello")
        {
            Visible = true;
            RenderBoundary = RenderBoundaryDefault;

            mManagers = managers;
            mChildren = new List<IRenderableIpso>();

            mRawText = text;
            mNeedsBitmapFontRefresh = true;
            mBounds = new LinePrimitive(this.Renderer.SinglePixelTexture);
            mBounds.Color = Color.LightGreen;

            mBounds.Add(0, 0);
            mBounds.Add(0, 0);
            mBounds.Add(0, 0);
            mBounds.Add(0, 0);
            mBounds.Add(0, 0);
            HorizontalAlignment = Graphics.HorizontalAlignment.Left;
            VerticalAlignment = Graphics.VerticalAlignment.Top;

#if !TEST
            if (LoaderManager.Self.DefaultBitmapFont != null)
            {
                this.BitmapFont = LoaderManager.Self.DefaultBitmapFont;
            }
#endif
            UpdateLinePrimitive();
        }
Example #19
0
        public static void UpdateLinePrimitive(LinePrimitive linePrimitive, IPositionedSizedObject ipso)
        {
            Matrix matrix = Matrix.CreateRotationZ(-MathHelper.ToRadians(ipso.Rotation));

            

            linePrimitive.Replace(0, Vector2.Zero);
            linePrimitive.Replace(1, Vector2.Transform(new Vector2(ipso.Width, 0), matrix) );
            linePrimitive.Replace(2, Vector2.Transform(new Vector2(ipso.Width, ipso.Height), matrix) );
            linePrimitive.Replace(3, Vector2.Transform(new Vector2(0, ipso.Height), matrix) );
            linePrimitive.Replace(4, Vector2.Zero); // close back on itself

        }