• 首页
  • 动态
  • 案例
  • 引擎社区
  • API
  • 文档
  • 示例
  • 引擎下载

大约有 31 项符合查询结果, 库内数据总量为 31,722 项。 (搜索耗时: 0.0043 秒)

1. 屏幕适配的缩放模式详解(TypeScript-2D基础篇(TS)-屏幕适配) [ 100%]

...幕宽高为`375*667`。LayaAir引擎可以通过laya.utils.Browser.clientWidth和laya.utils.Browser.clientHeight来获取屏幕的宽与高。 **6、物理宽高:** ​ 关于设备屏幕的物理宽高,我们需要先了解像素密度的概念。在PC电脑上,通常一个像素位置上就...

来源: Laya2.0_文档 发布时间: 20200307

2. 超出文本区域的处理&滚动文本(TypeScript-LayaAir基础篇(TS)-文本) [ 99%]

...uctor(){ // 不支持WebGL时自动切换至Canvas Laya.init(Browser.clientWidth, Browser.clientHeight, WebGL); Laya.stage.alignV = Stage.ALIGN_MIDDLE; Laya.stage.alignH = Stage.ALIGN_CENTER; Laya.stage.scaleMode = Stage.SCALE_SHOWALL; Laya.stage.bgColor = "#232628"; this.createText(); } private cre...

来源: Laya2.0_文档 发布时间: 20210715

3. 超出文本区域的处理&滚动文本(ActionScript-LayaAir基础篇(AS3)-文本) [ 94%]

...roll() { // 不支持WebGL时自动切换至Canvas Laya.init(Browser.clientWidth, Browser.clientHeight, WebGL); createText(); } private function createText():void { txt = new Text(); txt.overflow = Text.SCROLL; txt.text = "Layabox是HTML5引擎技术提供商与优秀的游戏发行商,面向AS/JS...

来源: Laya2.0_文档 发布时间: 20210715

4. 超出文本区域的处理&滚动文本(JavaScript-LayaAir基础篇(JS)-文本) [ 93%]

...tion() { // 不支持WebGL时自动切换至Canvas Laya.init(Browser.clientWidth, Browser.clientHeight, WebGL); Laya.stage.alignV = Stage.ALIGN_MIDDLE; Laya.stage.alignH = Stage.ALIGN_CENTER; Laya.stage.scaleMode = Stage.SCALE_SHOWALL; Laya.stage.bgColor = "#232628"; createText(); })(); function cre...

来源: Laya2.0_文档 发布时间: 20210714

5. 陀螺仪与加速计(TypeScript-LayaAir基础篇(TS)-硬件设备相关) [ 91%]

...info.fontSize = 50; this.info.color = "#FFFFFF"; this.info.size(Laya.stage.width, Laya.stage.height); Laya.stage.addChild(this.info); Laya.Gyroscope.instance.on(Laya.Event.CHANGE, this, this.onDeviceorientation); } private  onDeviceorientation(absolute: Boolean, rotationInfo: Laya.RotationInfo): vo...

来源: Laya2.0_文档 发布时间: 20210715

6. 位图字体的制作与使用(TypeScript-LayaAir基础篇(TS)-文本) [ 90%]

...,可以设定为`White text with alpha`,即白色字透明底。 | | Width | 导出的位图宽度 | | Height | 导出的位图高度 | | Font descriptor | 字体描述文件,必须要选择 xml | | Textures | 纹理图片格式,必须要选择 png | #### 第六步:导出位图字体 完...

来源: Laya2.0_文档 发布时间: 20210715

7. Label属性详解(TypeScript-IDE篇(TS)-IDE组件属性详解) [ 89%]

...vate createLabel(color: string, strokeColor: string): Label { const STROKE_WIDTH: number = 4; var label: Label = new Label(); label.font = "Microsoft YaHei"; label.text = "SAMPLE DEMO"; label.fontSize = 30; label.color = color; if (strokeColor) { label.stroke = STROKE_WIDTH; label.strokeColor = stro...

来源: Laya2.0_文档 发布时间: 20210715

8. 陀螺仪与加速计(JavaScript-LayaAir基础篇(JS)-硬件设备相关) [ 88%]

...info.fontSize = 50; this.info.color = "#FFFFFF"; this.info.size(Laya.stage.width, Laya.stage.height);  Laya.stage.addChild(this.info);  Laya.Gyroscope.instance.on(Laya.Event.CHANGE, this, onDeviceorientation); function onDeviceorientation(absolute, rotationInfo) { this.info.text = "alpha:" + Math....

来源: Laya2.0_文档 发布时间: 20210714

9. HScrollBar属性详解(TypeScript-IDE篇(TS)-IDE组件属性详解) [ 86%]

...his.hScrollBar.skin = "res/ui/hscroll.png"; //设置宽度 this.hScrollBar.width = 400; //设置位置 this.hScrollBar.pos(150, 170); //最低滚动位置数字 this.hScrollBar.min = 0; //最高滚动位置数字 this.hScrollBar.max = 100; //滚动变化事件回调 this.hScrollBar.changeHandler = n...

来源: Laya2.0_文档 发布时间: 20210715

10. VScrollBar属性详解(TypeScript-IDE篇(TS)-IDE组件属性详解) [ 86%]

...his.vScrollBar.skin = "res/ui/vscroll.png"; //设置宽度 this.vScrollBar.width = 400; //设置位置 this.vScrollBar.pos(150, 170); //最低滚动位置数字 this.vScrollBar.min = 0; //最高滚动位置数字 this.vScrollBar.max = 100; //滚动变化事件回调 this.vScrollBar.changeHandler = n...

来源: Laya2.0_文档 发布时间: 20210715