朱峰社區(qū)首頁(yè) 朱峰社區(qū)

搜索資源 注冊(cè)|登陸

等待

返回 展開菜單
按功能 按軟件

繪制真實(shí)照片

繪制真實(shí)照片

包含9節(jié)視頻教程

這是臨摹的終極表現(xiàn)!在臨摹領(lǐng)域達(dá)到真實(shí)照片的級(jí)別,讓你的繪畫讓別人驚呼吧!這不是照片,真的是繪畫出來的。我們一起來學(xué)習(xí)吧!

關(guān)閉

Unity組件:GUI Texture 用戶界面紋理

關(guān)注:1820 留言:0 樓主:漫奴L 001 發(fā)帖時(shí)間:15年11月16日

漫奴L 001

普通會(huì)員

漫奴L 001

社區(qū)新人:1級(jí)

關(guān)注1642人

  • 性別

  • 年齡

    18

  • 積分

    1

  • 登陸

    1

  • 發(fā)帖

    1

間隔線

GUI Textures are displayed as flat images in 2D. They are made especially for user interface elements, buttons, or decorations. Their positioning and scaling is performed along the x and y axes only, and they are measured in Screen Coordinates, rather than World Coordinates.

GUI紋理是顯示在二維的平面圖像。他們特別是于用戶界面元素,按鈕,或裝飾。它們的定位和縮放只通過改變X和Y軸來完成。它們是在屏幕坐標(biāo)測(cè)量,而不是世界坐標(biāo)。


The GUI Texture Inspector

Please Note: Unity 2.0 introduced UnityGUI, a GUI Scripting system. You may prefer creating user interface elements with UnityGUI instead of GUI Textures. Read more about how to use UnityGUI in the GUI Scripting Guide.

請(qǐng)注意: Unity 2.0 引入U(xiǎn)nityGUI,它是一個(gè)GUI腳本系統(tǒng)。您可能更愿意用UnityGUI代替GUI Textures來創(chuàng)建用戶界面元素 。了解更多有關(guān)如何使用UnityGUI在GUI腳本指南。

Properties 屬性
  • Texture 紋理
    Reference to the Texture that will be used as the texture's display.
    參考 Texture (用于紋理的顯示)
  • Color 顏色
    Color that will tint the Texture drawn on screen.
    將為繪制在屏幕上的紋理著色的顏色
  • Pixel Inset 像素插圖
    Used for pixel-level control of the scaling and positioning of the GUI Texture. All values are measured relative to the position of the GUI Texture's Transform.
    用于控制像素級(jí)的GUI紋理的縮放和位置。 所有的值都相對(duì)GUI紋理的變換位置進(jìn)行測(cè)量。
  •     X
    Left-most pixel position of the texture. 紋理最左邊像素的位置
  •     Y
    Bottom-most pixel position of the texture. 紋理最底部像素的位置
  •     Width 寬度
    Right-most pixel position of the texture. 紋理最右邊像素的位置
  •     Height 高度
    Top-most pixel position of the texture. 紋理最頂部像素的位置
  • Left Border 左邊界
    Number of pixels from the left that are not affected by scale.
    左邊不受大小規(guī)模影響的像素?cái)?shù)量。
  • Right Border 右邊界
    Number of pixels from the right that are not affected by scale.
    右邊不受大小規(guī)模影響的像素?cái)?shù)量。
  • Top Border 上邊界
    Number of pixels from the top that are not affected by scale.
    頂部不受大小規(guī)模影響的像素?cái)?shù)量。
  • Bottom Border 下邊界
    Number of pixels from the bottom that are not affected by scale.
    底部不受大小規(guī)模影響的像素?cái)?shù)量。
Details 詳情

To create a GUITexture 創(chuàng)建一個(gè)GUITexture:

  1. Select a Texture in the Project View 在項(xiàng)目視圖中選擇一個(gè)紋理
  2. Choose GameObject->Create Other->GUI Texture from the menu bar
    從菜單欄選擇 游戲物體 -> 創(chuàng)建其他 -> GUI紋理

GUI Textures are perfect for presenting game interface backgrounds, buttons, or other elements to the player. Through scripting, you can easily provide visual feedback for different "states" of the texture -- when the mouse is hovering over the texture, or is actively clicking it for example. Here is the basic breakdown of how the GUI Texture is calculated:

GUI紋理向玩家完美表現(xiàn)游戲界面背景,按鈕,或其他元素。通過腳本,你可以很容易地提供視覺反饋,針對(duì)不同的"狀態(tài)"的紋理 – 比如說: 當(dāng)鼠標(biāo)懸停在紋理上,或正在點(diǎn)擊紋理。這里是GUI??的紋理是如何計(jì)算的基本分類:


GUI Textures are laid out according to these rules
GUI 紋理根據(jù)這些規(guī)則被展示。


The GUI elements seen here were all created with GUI Textures
在這里看到的所有GUI元素都是由GUI紋理來創(chuàng)建的。

Borders 邊界

The number of pixels that will not scale with the texture at each edge of the image. As you rarely know the resolution your game runs in, chances are your GUI will get scaled. Some GUI textures have a border at the edge that is meant to be an exact number of pixels. In order for this to work, set the border sizes to match those from the texture.

像素的總數(shù)不與在圖像上各邊緣的紋理成比例。正如你很少知道你的游戲運(yùn)行的分辨率 ,GUI將擴(kuò)展。一些GUI紋理的邊緣有邊框,它應(yīng)該是一個(gè)確切的像素?cái)?shù)量。為了讓他可行,設(shè)置邊框的大小以匹配紋理。

Pixel Inset 像素嵌入

The purpose of the Pixel Inset is to prevent textures from scaling with screen resolution, and keeping thim in a fixed pixel size. This allows you to render a texture without any scaling. This means that players who run your game in higher resolutions will see your textures in smaller areas of the screen, allowing them to have more screen real-estate for your gameplay graphics.

像素嵌入的目的是為了防止紋理與屏幕分辨率成比例和保持固定像素大小。這可以讓你沒有任何縮放地渲染一個(gè)紋理 。這意味著玩家更高的分辨率下運(yùn)行游戲?qū)⒖吹侥愕募y理變小了,讓他們有更屏幕資源去顯示你的游戲圖形。

To use it effectively, you need to set the scale of the GUI Texture's Transform to (0, 0, 0). Now, the Pixel Inset is in full control of the texture's size and you can set the Pixel Inset values to be the exact pixel size of your Texture.

為了有效地使用它,你需要設(shè)定GUI紋理變換屬性(Transform)里的大小(scale)設(shè)置為(0,0,0)。現(xiàn)在,像素嵌入是完全控制紋理的大小,你可以設(shè)置你的像素嵌入值為你的紋理確切的像素大小。

Hints 提示
  • The depth of each layered GUI Texture is determined by its individual Z Transform position, not the global Z position.
    每一層GUI紋理深度是由其自身變換(Transform)位置(position)里的Z坐標(biāo)決定,而不是世界坐標(biāo)變換(Transform)位置(position)的Z坐標(biāo)。
  • GUI Textures are great for making menu screens, or pause/escape menu screens.
    利用GUI紋理 可以很好的制作菜單,或暫停/退出菜單。
  • You should use Pixel Inset on any GUI Textures that you want to be a specific number of pixels for the width and height.
    如果你想制作一個(gè)特定像素寬度和高度的GUI紋理。你應(yīng)該用像素嵌入。

贊0 踩0

未知用戶

2005-2025 朱峰社區(qū) 版權(quán)所有 遼ICP備2021001865號(hào)-1
2005-2025 ZhuFeng Community All Rights Reserved

VIP

朱峰社區(qū)微信公眾號(hào)

回頂部

1.復(fù)制文本發(fā)給您的QQ好友或群、微信等;好友點(diǎn)擊鏈接以后,轉(zhuǎn)發(fā)就成功了。 2.如朋友點(diǎn)擊您的鏈接,您需要需刷新一下才行;同一個(gè)好友僅能點(diǎn)擊一次。
購(gòu)買VIP,觀看所有收費(fèi)教程!