Esempio n. 1
0
        public void Font_SaveLoad_Test()
        {
            string name = "Font0";
            var texture = AssetManager.Load(@"Engine/system12.tga") as Texture;
            var dataFile = Path.Combine(RenderSettings.MediaPath, "Engine/system12.dat");
            var font = new Font(name, texture, dataFile);
            font.Save("Font.font");

            var font2 = Font.Load(Device, "Font.font", name, AssetManager);
            Assert.AreEqual(name, font2.Name);
        }
Esempio n. 2
0
        public void Font_Print_Test()
        {
            var texture = new Texture(Device, Path.Combine(RenderSettings.MediaPath, "Engine/system12.tga"), "");
            string fontData = Path.Combine(RenderSettings.MediaPath, "Engine/system12.dat");
            var font = new Font("system12", texture, fontData);

            Device.RawDevice.BeginScene();
            SpriteRenderer.RawSprite.Begin(D3D.SpriteFlags.AlphaBlend);
            Assert.IsTrue(font.Print("text", Vector2.Zero, Color.White, SpriteRenderer));
            SpriteRenderer.RawSprite.End();
            Device.RawDevice.EndScene();
        }
Esempio n. 3
0
 public FontSampleSprite(Font font, string sampleText, Color textColor, Vector2 printPos, float scale)
 {
     this.font = font;
     this.sampleText = sampleText;
     this.textColor = textColor;
     this.printPos = printPos;
     this.scale = scale;
 }