🎁
🏆 导航菜单
🎪 扩展内容
🎯 沙盘引擎文档
🕹️ 文章及书籍&教程
🎖️ 外部的链接
🎁
🏆 导航菜单
🎪 扩展内容
🎯 沙盘引擎文档
🕹️ 文章及书籍&教程
🎖️ 外部的链接
获取展示牌序列ID,每个实例ID是唯一的。
当之前的实例被销毁后,空闲的靠前ID将会被后续新实例重新使用(对于特殊情况,
UUID
是更合适的筛选选择)。
billboard.ID: int
获取展示牌UUID,这是由一串较长的字符串组成的全局唯一文本ID(实例化时自动赋值,非持久化数据)。
billboard.UUID: string
设置展示牌坐标。
billboard.Pos = Vector(0, 0, 0);
设置展示牌实例世界ID(不同世界将不可视\不可交互)。
billboard.World = 0; //int
获取展示牌实例类型,不同类型的展示牌有不同的作用和特定属性。
Billboard.Type: int
Type | 说明 |
---|---|
0(图片|Sprite) | 展示一张图片billboard.Sprite |
1(气泡文本|Bubble) | 展示一段文本billboard.Text |
2(进度条|ProgressBar) | 展示一个进度条billboard.Progress |
设置展示牌实例对象颜色,不同的
Type
对象有不同的默认值(例如Sprite: White;Bubble: Black;ProgressBar: Blue
)。注意:这里所设置的颜色目标不一定是想象中的目标,比如
Bubble
设置的颜色其实是【气泡背景颜色】,如果想修改文本颜色请使用Text
UBB颜色代码。
billboard.Color = Color(255, 255, 255, 255); //Color
设置展示牌实例整体透明度,默认为
255
。
billboard.Alpha = 255; //int
设置展示牌实例尺寸缩放(比例),默认尺寸比例是
1.0
。
billboard.Scale = 1.0; //float
设置展示牌是否存在遮挡逻辑,默认为
true
,如果设置false
将不会被其他物体遮挡。
billboard.Baffle = true; //bool
设置展示牌是否存在碰撞逻辑,默认为
false
,通常情况下不需要进行修改。
billboard.Collision = false; //bool
设置展示牌跟随绑定对象,默认为
null
。
billboard.Target = null; //Entity(Character\Vehicle等)
设置展示牌本地坐标偏移,默认为
Vector(0, 0, 0)
。如果想实现角色头顶显示名字,可以先绑定
Target
然后将偏移高度增加(例如Vector(0, 2, 0)
)。
billboard.Offset = Vector(0, 0, 0);
设置展示牌显示图片(只在
Type: 0
模式生效),设置-1
则不显示图片。
billboard.Sprite = 0; //int(基于Store/Texture资源机制)
设置展示牌显示气泡文本(只在可附带文本的组件生效,例如图片组件则是无效的)。
billboard.Text = "Hello World!"; //string
设置展示牌显示进度条样式(只在
Type: 2
模式生效)。
billboard.ProgressType = 0; //int
Type | 说明 |
---|---|
0 | 无进度条进度文本 |
1 | 百分比进度文本 |
2 | 当前值进度文本 |
3 | 当前值/最大值进度文本 |
设置展示牌显示进度条进度百分比(只在
Type: 2
模式生效),设置范围0.0~1.0
。
billboard.Progress = 0.0; //float
设置展示牌显示进度条最大进度(只在
Type: 2
模式生效)。
billboard.MaxProgress = 0.0; //float
设置展示牌忽略匹配表达式。
表达式内包含的
PlayerID
将被屏蔽(不可见),这可能用于【玩家头顶名称】对玩家自身不可见等情况。
billboard.IgnoreMatch = ""; //string
billboard.IgnoreMatch = "2"; //Ignore player id == 2 billboard.IgnoreMatch = "2|3|5|7|8"; //Ignore player id == 2\3\5\7\8
生成一个新的展示牌实例,
Type
类型样式参考Billboard.Type
属性介绍。
function Billboard.Create( type: int, pos: Vector = Vector(0, 0, 0) ): Billboard
//在0点坐标处,建立一个类型为0展示牌实例 let newBB = Billboard.Create(0, Vector(0, 0, 0)); //建立完成后,还需要根据其Type类型为其添加其他属性 newBB.Sprite = 0; //因为是Type0(图片)类型,所以设置Sprite属性为0号图片
生成一个小文本气泡实例(类似【血量-10】的气泡样式),这是一个本地静态实例,因此没有返回值。
function Billboard.CreateTips( text: string, pos: Vector, time: float = 3, scale: float = 1, hasBG: bool = true, hasRotate: bool = true )
生成一个图片气泡实例(可实现表情图片等),这是一个本地静态实例,因此没有返回值。
function Billboard.CreateSpriteBubble( texture: int, pos: Vector, time: float = 3, scale: float = 1, hasBG: bool = true, hasRotate: bool = true )
寻找一个展示牌实例(通过ID),不存在则返回
null
。
function Billboard.Find( id: int ): Billboard
寻找一个展示牌实例(通过UUID),不存在则返回
null
。
function Billboard.FindByUUID( uuid: string ): Billboard
获取当前所有存在展示牌数量(不包括静态对象)。
function Billboard.GetCount(): int
获取当前存在的指定索引展示牌实例,通常搭配
GetCount()
遍历使用。
function Billboard.Get( index: int ): Billboard
销毁当前展示牌实例。
function billboard.Remove()