zoukankan      html  css  js  c++  java
  • Unity

    Material Icon字体下载(github)

    前面的返回按钮, 以及自己试验的一些Icon都不显示, 然后回去翻UIWidgets的README

         public class UIWidgetsExample : UIWidgetsPanel {
             protected override void OnEnable() {
                 // if you want to use your own font or font icons.
                 // FontManager.instance.addFont(Resources.Load<Font>(path: "path to your font"), "font family name");
    
                 // load custom font with weight & style. The font weight & style corresponds to fontWeight, fontStyle of
                 // a TextStyle object
                 // FontManager.instance.addFont(Resources.Load<Font>(path: "path to your font"), "Roboto", FontWeight.w500,
                 //    FontStyle.italic);
    
                 // add material icons, familyName must be "Material Icons"
                 // FontManager.instance.addFont(Resources.Load<Font>(path: "path to material icons"), "Material Icons");
    
                 base.OnEnable();
             }
    

    emmm

    下载字体放到AssetsResourcesFonts
    修改UI入口处

    // UIMain.lua
    
    using System.Collections.Generic;
    using Unity.UIWidgets.engine;
    using Unity.UIWidgets.material;
    using Unity.UIWidgets.ui;
    using Unity.UIWidgets.widgets;
    using UnityEngine;
    
    namespace UI
    {
        public class UIMain : UIWidgetsPanel
        {
            protected override void OnEnable()
            {
                FontManager.instance.addFont(Resources.Load<Font>(path: "Fonts/MaterialIcons-Regular"), "Material Icons");
    
                base.OnEnable();
            }
    
            // ...
        }
    }
    
    

    图标就可以正常显示了

  • 相关阅读:
    hdu 3996
    poj 3189
    poj 2391
    zoj 3165
    【Visual Studio】
    httpwebrequest Winform 上传图片
    [MVC] win7 下 配置 IIS 问题
    win7 下 升级 vs2008
    [Visual Studio 2010] NET 4.0 WinForm无法引用System.Web.dll的解决方法
    [XML] XML
  • 原文地址:https://www.cnblogs.com/lunoctis/p/12238615.html
Copyright © 2011-2022 走看看