NGUI v2.0 UI_2:UIAtlas UI图集类

本文详细介绍UIAtlas类的功能和使用方法,包括精灵管理、坐标系统切换、材质与纹理配置等核心特性,并提供实用的API说明。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

UIAtlas

 

 

UIAtlas Class Reference
UIAtlas类引用

UI Atlas contains a collection of sprites inside one large texture atlas. More...

UI地图集包含一组在一个大型结构地图集精灵。更多…

 

List of all members.所有成员的列表。

Classes

class  Sprite

Public Types公共类型

enum  Coordinates
 Pixels coordinates are values within the texture specified in pixels. They are more intuitive, but will likely change if the texture gets resized. TexCoord coordinates range from 0 to 1, and won't change if the texture is resized. You can switch freely from one to the other prior to modifying the texture used by the atlas.More...
像素坐标之内的值中指定的纹理像素。他们更直观,但可能会改变,如果调整纹理结构会被改变。TexCoord坐标范围从0到1,如果纹理的大小调整不会被改变。你可以自由切换从一边到另一边之前通过图集调整其结构。更多…

Public Member Functions公共成员函数

Sprite GetSprite (string name)
 Convenience function that retrieves a sprite by name. 
便利函数,通过名称检索一个精灵。
List< string > GetListOfSprites ()
 Convenience function that retrieves a list of all sprite names.
便利函数,获取列表的 据所以精灵的名字。
void MarkAsDirty ()
 Mark all widgets associated with this atlas as having changed.
图集改变时 标记所有与此相关的小部件。

Static Public Member Functions静态公共成员函数

static bool CheckIfRelated (UIAtlas a, UIAtlas b)
 Helper function that determines whether the two atlases are related.
Helper函数,决定了两个地图集是相关的。

Properties属性

Material spriteMaterial [get, set]
 Material used by the atlas. 
图集采用的材质
List< SpritespriteList [get, set]
 

List of sprites within the atlas. 
图集的的精灵列表。

Texture texture [get]
 Texture used by the atlas. 
图集使用的纹理
Coordinates coordinates [get, set]
 Allows switching of the coordinate system from pixel coordinates to texture coordinates.
允许坐标系从像素坐标到纹理坐标的转换。
UIAtlas replacement [get, set]
 Setting a replacement atlas value will cause everything using this atlas to use the replacement atlas instead. Suggested use: set up all your widgets to use a dummy atlas that points to the real atlas. Switching that atlas to another one (for example an HD atlas) is then a simple matter of setting this field on your dummy atlas.
设置一个替换地图集值将导致所有使用这个地图集的对象使用被替代的图集。建议用法:设置所有的小部件使用一个虚拟的地图集。切换到另一个图集(例如一个高清图集)是很简单的 设置此图集到你的虚拟图集。

Detailed Description详细描述

UI Atlas contains a collection of sprites inside one large texture atlas. UI地图集包含一组在一个大型结构地图集精灵。


Member Enumeration Documentation成员枚举文档

Pixels coordinates are values within the texture specified in pixels. They are more intuitive, but will likely change if the texture gets resized. TexCoord coordinates range from 0 to 1, and won't change if the texture is resized. You can switch freely from one to the other prior to modifying the texture used by the atlas.

像素坐标之内的值中指定的纹理像素。他们更直观,但可能会改变,如果调整纹理结构会被改变。TexCoord坐标范围从0到1,如果纹理的大小调整不会被改变。你可以自由切换从一边到另一边之前通过图集调整其结构。


Member Function Documentation
成员函数文档

static bool UIAtlas.CheckIfRelated(UIAtlas a,
  UIAtlas b 
 ) [static]

Helper function that determines whether the two atlases are related.

Helper函数,决定了两个地图集是相关的。

List<string> UIAtlas.GetListOfSprites( ) 

Convenience function that retrieves a list of all sprite names.

便利函数,获取列表的 据所以精灵的名字。

SpriteUIAtlas.GetSprite(string name) 

Convenience function that retrieves a sprite by name.

便利函数,通过名称检索一个精灵。
void UIAtlas.MarkAsDirty( ) 

Mark all widgets associated with this atlas as having changed.


Property Documentation属性文档

Allows switching of the coordinate system from pixel coordinates to texture coordinates.

允许交换的坐标系从像素坐标纹理坐标。

Setting a replacement atlas value will cause everything using this atlas to use the replacement atlas instead. Suggested use: set up all your widgets to use a dummy atlas that points to the real atlas. Switching that atlas to another one (for example an HD atlas) is then a simple matter of setting this field on your dummy atlas.

设置一个替换地图集值将导致所有使用这个地图集的对象使用被替代的图集。建议用法:设置所有的小部件使用一个虚拟的地图集。切换到另一个图集(例如一个高清图集)是很简单的 设置此图集到你的虚拟图集。

List<Sprite>UIAtlas.spriteList [get, set]

List of sprites within the atlas. 图集的精灵列表。

Material UIAtlas.spriteMaterial [get, set]

Material used by the atlas. 图集使用的材质

Texture UIAtlas.texture [get]

Texture used by the atlas. 图集使用的纹理


The documentation for this class was generated from the following file:这个类的文档生成从以下文件:
  • Assets/NGUI/Scripts/UI/UIAtlas.cs
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值