Add() public method

Adds a vector to the primive live object.
public Add ( Vector2 vector ) : void
vector Vector2 The vector to add.
return void
示例#1
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;
        }
示例#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;
        }
示例#3
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;
        }
示例#4
0
        void UpdatePoints()
        {
            mLinePrimitive.ClearVectors();

            float width  = mColumnWidth * mColumnCount;
            float height = mRowWidth * mRowCount;

            float currentY = 0;

            for (int i = 0; i < mRowCount + 1; i++)
            {
                currentY = i * mRowWidth;
                mLinePrimitive.Add(0, currentY);
                mLinePrimitive.Add(width, currentY);
            }

            float currentX = 0;

            for (int i = 0; i < mColumnCount + 1; i++)
            {
                currentX = i * mColumnWidth;
                mLinePrimitive.Add(currentX, 0);
                mLinePrimitive.Add(currentX, height);
            }
        }
示例#5
0
        public void SetPoints(ICollection <Vector2> points)
        {
            mLinePrimitive.ClearVectors();

            if (points != null)
            {
                foreach (var point in points)
                {
                    mLinePrimitive.Add(point);
                }
            }
        }
示例#6
0
文件: Line.cs 项目: vchelaru/Anfloga
        private void UpdatePoints()
        {
            while (mLinePrimitive.VectorCount < 2)
            {
                mLinePrimitive.Add(0, 0);
            }

            mLinePrimitive.Replace(1, this.RelativePoint);

            mLinePrimitive.Position.X = this.GetAbsoluteX();
            mLinePrimitive.Position.Y = this.GetAbsoluteY();
        }
示例#7
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();
        }