Exemplo n.º 1
0
 public void SetFont(string fontName)
 {
     Font = Game.Instance.ResourceManager.Font.Load(fontName);
 }
Exemplo n.º 2
0
 public Material GetMaterial(UIFont font)
 {
     if(!mMaterials.ContainsKey(font))
     {
         var desc = new MaterialDesc();
         desc.Passes[0].InputElements = new InputElement[]{
             new InputElement("POSITION", 0, Format.R32G32B32_Float, 0, 0),
             new InputElement("TEXCOORD", 0, Format.R32G32_Float, 12, 0),
         };
         desc.Passes[0].BlendStates = CreateAlphaBlendState();
         desc.Passes[0].ShaderFile = "UIFont.hlsl";
         desc.Passes[0].Textures = new MaterialTextureDesc[1];
         desc.Passes[0].Textures[0] = new MaterialTextureDesc();
         var m = new Material(Game.Instance, desc, font.Texture.DebugName);
         m.Passes[0].TextureList[0] = font.Texture;
         mMaterials[font] = m;
         Game.Instance.AddObject(m);
     }
     return mMaterials[font];
 }