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

  • 相关阅读:
    安装SQLserver2008时出现的错误
    第二章 语法陷阱
    分享:APK高级保护方法解析(三)
    设计模式_命令模式
    POJ-3134-Power Calculus(迭代加深DFS)
    Rational Rose2007具体安装步骤
    webAPP开发的问题(总结)
    基于Linux的智能家居的设计(5)
    获取表数据的插入SQL
    POJ 3667 Hotel(线段树)
  • 原文地址:https://www.cnblogs.com/tekkaman/p/3803813.html
Copyright © 2011-2022 走看看