Пример #1
0
        public override void Draw(SpriteBatch sb)
        {
            float extra = 15;

            width         = drop.BoundBox.Width;
            drop.Position = new Vector2(Position.X - (width / 2), Position.Y + 5);
            string  toDraw = "";
            Vector2 ArrowStartPos;

            if (selectedIndex >= 0)
            {
                toDraw = drop.items[selectedIndex].text;
            }

            label.text = toDraw;

            ArrowStartPos = new Vector2(BoundBox.Right - 12, Position.Y - 3);

            DrawManager.Draw_Box(Position + new Vector2(extra / 2, 0), width + extra, height, backColor, sb, 0f, 255);
            DrawManager.Draw_Outline(Position + new Vector2(extra / 2, 0), width + extra, height, Color.Black, sb);
            if (!drop.active)
            {
                DrawManager.Draw_Line(ArrowStartPos, ArrowStartPos + new Vector2(4, 6), Color.White, sb);
                DrawManager.Draw_Line(ArrowStartPos + new Vector2(4, 6), ArrowStartPos + new Vector2(8, 0), Color.White, sb);
            }
            else
            {
                DrawManager.Draw_Line(ArrowStartPos + new Vector2(0, 6), ArrowStartPos + new Vector2(4, 0), Color.White, sb);
                DrawManager.Draw_Line(ArrowStartPos + new Vector2(4, 0), ArrowStartPos + new Vector2(8, 6), Color.White, sb);
                drop.Draw(sb);
            }

            label.Draw(sb);
        }
Пример #2
0
 public override void Draw(Microsoft.Xna.Framework.Graphics.SpriteBatch sb)
 {
     label.Draw(sb);
     DrawManager.Draw_Circle(Position, radius, backColor, borderColor, sb);
     if (selected)
     {
         DrawManager.Draw_Circle(Position, radius / 1.5f, selectedColor, selectedColor, sb, 255, 1);
     }
     //base.Draw(sb);
 }
Пример #3
0
 public void DrawTest()
 {
     SpriteFont font = null; // TODO: Initialize to an appropriate value
     string text = string.Empty; // TODO: Initialize to an appropriate value
     Vector2 position = new Vector2(); // TODO: Initialize to an appropriate value
     Color color = new Color(); // TODO: Initialize to an appropriate value
     TextAlign align = new TextAlign(); // TODO: Initialize to an appropriate value
     TextDrawer target = new TextDrawer(font, text, position, color, align); // TODO: Initialize to an appropriate value
     SpriteBatch sb = null; // TODO: Initialize to an appropriate value
     target.Draw(sb);
     Assert.Inconclusive("A method that does not return a value cannot be verified.");
 }
Пример #4
0
        public override void Draw(SpriteBatch sb)
        {
            td.Position = Position;
            if (!active)
            {
                return;
            }
            NinePatch patch  = base.mouseOver ? patchHover : patchNormal;
            Vector2   center = ConversionManager.PToV(BoundBox.Center);

            patch.Draw(sb, center - patch.getCenter(td.BoundBox.Width + paddingWidth, td.BoundBox.Height), td.BoundBox.Width + paddingWidth, td.BoundBox.Height + paddingHeight);
            td.Draw(sb);
            //YogUILibrary.Managers.DrawManager.Draw_Circle(Position, 5f, Color.Red, Color.Black, sb);
            //base.Draw();
        }
Пример #5
0
        public override void Draw(SpriteBatch sb)
        {
            labelDrawer.Draw(sb);

            DrawManager.Draw_Box(Position, width, height, backColor, sb, 0f, 200);
            DrawManager.Draw_Outline(Position, width, height, borderColor, sb, 255);

            Vector2 checkLower  = new Vector2(Position.X - 2, Position.Y - 2);
            Vector2 checkCenter = new Vector2(Position.X, Position.Y + (height / 2) - 1);
            Vector2 checkHigher = new Vector2(Position.X + (width / 2), Position.Y - (height / 2));

            if (state)
            {
                DrawManager.Draw_Line(checkLower, checkCenter, checkColor, sb);
                DrawManager.Draw_Line(checkHigher, checkCenter, checkColor, sb);
            }

            // base.Draw();
        }
Пример #6
0
 public override void Draw(SpriteBatch sb)
 {
     progressBar.Draw(sb);
     progressText.Draw(sb);
     //base.Draw();
 }
Пример #7
0
        public override void Draw(SpriteBatch sb)
        {
            if (cursorPos < 0)
            {
                cursorPos = 0;
            }
            if (cursorPos > input.Length)
            {
                cursorPos = input.Length;
            }
            string measureT = "";

            for (int i = offset; i < cursorPos && i < input.Length; i++)
            {
                measureT += input[i];
                float width = tdI.font.MeasureString(measureT).X;
                if (width > allowedWidth)
                {
                    offset++;
                }
            }
            if (cursorPos - offset < 0)
            {
                offset = cursorPos;
            }
            if (offsetText.Length == 0 && input.Length != 0)
            {
                offset--;
            }

            Vector2 selection = getFixedSelection();

            if (selection.X != -1 && selection.Y != -1 && (selection.X != selection.Y))
            {
                selection.X -= offset;
                selection.Y -= offset;
                //if (selection.Y > numCharsAllowed && numCharsAllowed != -1) selection.Y = numCharsAllowed;
                if (selection.X < 0)
                {
                    selection.X = 0;
                }
                string offsetT = offsetText;
                string before  = "";
                string inside  = "";
                for (int i = 0; i < selection.X; i++)
                {
                    before += offsetT[i];
                }
                for (int i = (int)selection.X; i < selection.Y && i < offsetT.Length; i++)
                {
                    inside += offsetT[i];
                }
                selection.X  = tdI.font.MeasureString(before).X;
                selection.Y  = tdI.font.MeasureString(before + inside).X;
                selection.X += tdI.BoundBox.Left;
                selection.Y += tdI.BoundBox.Left;
                selection.X -= 2;
                DrawManager.Draw_Box(new Vector2(selection.X, tdI.BoundBox.Top + 2), new Vector2(selection.Y, tdI.BoundBox.Bottom - 4), Color.Blue * .5f, sb, 0f, 25);
            }

            tdI.Position = Position;
            if (active)
            {
                tdI.Draw(sb);
            }
            if (mainDelim != null)
            {
                cursorPos -= offset;
                string text    = offsetText;
                string measure = "";
                for (int i = 0; i < cursorPos && text.Length > 0 && i < text.Length; i++)
                {
                    measure += text[i];
                }
                sb.DrawString(tdI.font, mainDelim, tdI.Position + new Vector2(tdI.font.MeasureString(measure).X - 3, 0), tdI.color);
                cursorPos += offset;
            }
            //base.Draw();
        }
Пример #8
0
 public override void Draw(SpriteBatch sb)
 {
     tdI.Draw(sb);
     //base.Draw();
 }