예제 #1
0
        public void ShowGUI(List <GUIItem> GUIItems)
        {
            foreach (var option in GUIItems)
            {
                LinkedList <Vector2> optionDisplay;

                //Figures out if it is a title or not then makes the display item
                if (option.IsTitle)
                {
                    optionDisplay = MyFont.GetWord(titleFontScaleSize, option.TextToDisplay);
                }
                else
                {
                    optionDisplay = MyFont.GetWord(regularFontScaleSize, option.TextToDisplay);
                }

                foreach (Vector2 v2 in optionDisplay)
                {
                    pb.AddVertex(v2 + option.Position, option.Color);
                }

                if (option.MenuItem)
                {
                    itemPositionList.Add(option.Position);
                }
            }
        }
예제 #2
0
        public static void ShowEntireFont(PrimitiveBatch pb)
        {
            int scaleForFontDisplay = 8;

            LinkedList <Vector2> row1 = new LinkedList <Vector2>();
            LinkedList <Vector2> row2 = new LinkedList <Vector2>();
            LinkedList <Vector2> row3 = new LinkedList <Vector2>();
            LinkedList <Vector2> row4 = new LinkedList <Vector2>();

            Vector2 row1Position = new Vector2(10, 50);
            Vector2 row2Position = new Vector2(10, 100);
            Vector2 row3Position = new Vector2(10, 150);
            Vector2 row4Position = new Vector2(10, 200);

            row1 = MyFont.GetWord(scaleForFontDisplay, "a b c d e f g h i j");
            row2 = MyFont.GetWord(scaleForFontDisplay, "k l m n o p q r s t");
            row3 = MyFont.GetWord(scaleForFontDisplay, "u v w x y z 1 2 3 4");
            row4 = MyFont.GetWord(scaleForFontDisplay, "5 6 7 8 9 0 .");

            pb.Begin(PrimitiveType.LineList);

            foreach (Vector2 v2 in row1)
            {
                pb.AddVertex(v2 + row1Position, Color.White);
            }

            foreach (Vector2 v2 in row2)
            {
                pb.AddVertex(v2 + row2Position, Color.White);
            }

            foreach (Vector2 v2 in row3)
            {
                pb.AddVertex(v2 + row3Position, Color.White);
            }

            foreach (Vector2 v2 in row4)
            {
                pb.AddVertex(v2 + row4Position, Color.White);
            }

            pb.End();
        }