zoukankan      html  css  js  c++  java
  • 3D Text & GUI Text & GUI Texture

    Unity3D Text

      3D Text通过"Text Mesh"组件、"MeshRender共同完成",通过如下方法要以创建一个3D Text。

      

      3D Text对象包含如下组件:

      

      最常用的需要所有人都关注的三个方法如下:

      

      Font必须是ttf字体,导入ttf很简单,直接把ttf文件放入工程的Asset目录或子目录中即可。

      

    参考:file://localhost/Applications/Unity/Unity.app/Contents/Documentation/Documentation/Components/class-TextMesh.html

    GUI Text

      通过 Hierarchy 中的"Create" -> "GUI Text"创建。

      

      其中关键参数有几下几个:

      

      Material: Reference to the Material containing the characters to be drawn. If set, this property overrides the one in the Font asset.

      Pixel  Correct:If enabled, all Text characters will be drawn in the size of the imported font texture. If disabled, the characters will be resized based on the Transform's Scale.

      注意要点:

      GUI Texts are used to print text onto the screen in 2D. The Camera has to have a GUI Layer attached in order to render the text. Cameras include a GUI Layer by default, so don't remove it if you want to display a GUI Text. GUI Texts are positioned using only the X and Y axes. Rather than being positioned in World Coordinates, GUI Texts are positioned in Screen Coordinates, where (0,0) is the bottom-left and (1,1) is the top-right corner of the screen.

    GUILayer

      

    GUI Texture

      GUI Texture用于显示一个texture,一个texture可以用作九宫格。另外一个texture有大小。

      

      GUI Texture属性如上,很简单。和GUI Text一样,它俩作为仅有的2个受GUILayer组件影响的对象,是Unity抛弃的东西,UnityGUI被设计用来替代它俩。

    参考:file:///D:/Program%20Files%20(x86)/Unity/Editor/Data/Documentation/Documentation/Components/class-GuiTexture.html

  • 相关阅读:
    VC++ 利用PDB和dump文件定位问题并进行调试
    MFC限制edit控件的字符输入长度
    VC++ 使用CreateProcess创建新进程
    正则表达式验证HTTP地址是否合法
    C++ _access和_waccess的使用方法
    最后一次谈 VirtualBox的安装方法
    解决/var/log下没有messages文件的问题?
    待续未完- 自己写后台内容管理程序的辅助内容
    php中的正则函数:正则匹配,正则替换,正则分割 所有的操作都不会影响原来的字符串.
    未完待续
  • 原文地址:https://www.cnblogs.com/tekkaman/p/3803813.html
Copyright © 2011-2022 走看看