教学文库网 - 权威文档分享云平台
您的当前位置:首页 > 范文大全 > 文秘资料 >

unity3D技术之gui.selectiongrid 选择网格

来源:网络收集 时间:2026-07-16
导读: unity3D技术 static functionselectiongrid(position:rect,selected: int,texts:string[],xcount: int) : int static functionselectiongrid(position:rect,selected: int,images:texture[],xcount: int) : int static functionselectiongrid(position:rect,

unity3D技术

static functionselectiongrid(position:rect,selected: int,texts:string[],xcount: int) : int

static functionselectiongrid(position:rect,selected: int,images:texture[],xcount: int) : int static functionselectiongrid(position:rect,selected: int,content:guicontent[],xcount: int) : int

static functionselectiongrid(position:rect,selected: int,texts:string[],xcount: int,style:guistyle) : int static functionselectiongrid(position:rect,selected: int,images:texture[],xcount: int,style:guistyle) : int

static functionselectiongrid(position:rect,selected: int,contents:guicontent[],xcount: int,style:guistyle) : int

parameters参数【】

position

rectangle on the screen to use for the grid.

用于网格在屏幕上的矩形位置。

selected

the index of the selected grid button

被选择表格按钮的索引号。

texts

an array of strings to show on the grid buttons.

显示在网格按钮上的字符串数组。

images

an array of textures on the grid buttons.

在网格按钮上的纹理图片数组。

contents

an array of text, image and tooltips for the grid button.

用于网格按钮的文本,图片和提示数组。

xcount

how many elements to fit in the horizontal direction. the controls will be scaled to fit unless the style defines a fixedwidth to use.

在水平方向上有多少元素,控件将缩放去适合宽度,除非样式定义了固定宽度(fixedwidth)。 style

the style to use. if left out, the button style from the current guiskin is used.

使用样式,如果不使用,按钮样式应用当前的guiskin皮肤。

returns

int - the index of the selected button.

返回int类型,被选择按钮的索引号。

description描述

make a grid of buttons.

创建一个网格按钮。

c#

javascript

using unityengine;

using system.collections;

public class example :monobehaviour{

public int selgridint = 0;

public string[] selstrings = new string[] {"grid 1", "grid 2", "grid 3", "grid 4"};

unity3D技术

void ongui() {

selgridint =gui.selectiongrid(newrect(25, 25, 100, 30), selgridint, selstrings, 2); }

}

var selgridint : int = 0;

var selstrings :string[] = ["grid 1", "grid 2", "grid 3", "grid 4"];

function ongui () {

selgridint =gui.selectiongrid(rect(25, 25, 100, 30), selgridint, selstrings, 2); }

unity3D技术之gui.selectiongrid 选择网格.doc 将本文的Word文档下载到电脑,方便复制、编辑、收藏和打印
本文链接:https://www.jiaowen.net/fanwen/2080003.html(转载请注明文章来源)
Copyright © 2020-2025 教文网 版权所有
声明 :本网站尊重并保护知识产权,根据《信息网络传播权保护条例》,如果我们转载的作品侵犯了您的权利,请在一个月内通知我们,我们会及时删除。
客服QQ:78024566 邮箱:78024566@qq.com
苏ICP备19068818号-2
Top
× 游客快捷下载通道(下载后可以自由复制和排版)
VIP包月下载
特价:29 元/月 原价:99元
低至 0.3 元/份 每月下载150
全站内容免费自由复制
VIP包月下载
特价:29 元/月 原价:99元
低至 0.3 元/份 每月下载150
全站内容免费自由复制
注:下载文档有可能出现无法下载或内容有问题,请联系客服协助您处理。
× 常见问题(客服时间:周一到周五 9:30-18:00)