Beispiel #1
0
        public BmFont(Texturing texturingManager, string name)
        {
            System.Console.WriteLine("Loading BmFont \"" + name + "\"");

            texId = texturingManager.LoadTexture(fontDir + name + ".png");
            string[] lines = System.IO.File.ReadAllLines(fontDir + name + ".fnt");

            for (int i = 0; i < lines.Length; i++)
            {
                string line = lines[i].Trim();

                //Comments
                if (line.StartsWith("#"))
                {
                    continue;
                }

                string[] args = line.Split(' ');

                if (args[0].Equals("common"))
                {
                    parseCommon(args);
                }
                else if (args[0].Equals("char"))
                {
                    parseCharacter(args);
                }
                else if (args[0].Equals("kerning"))
                {
                    parseKerning(args);
                }
            }
        }
Beispiel #2
0
 private void glControl_Load(object sender, EventArgs e)
 {
     glControl.MakeCurrent();
     GL.Enable(EnableCap.Texture2D);
     GL.ClearColor(Color.FromArgb(200, 200, 200));
     renderer  = new Renderer();
     texturing = new Texturing();
     camera    = new Camera(new Vector2(0, 0), 1.0);
     for (int i = 0; i < 52; i++)
     {
         texIds.Add(texturing.LoadTexture("Resources/tiles/" + i + ".png"));
     }
     t          = new System.Timers.Timer(1000.0 / 60.0);
     t.Elapsed += t_Elapsed;
     t.Start();
 }