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

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

11. 文本基础样式(JavaScript-LayaAir基础篇(JS)-文本) [ 75%]

... ![1](img/1.png) ![2](img/2.png) ```typescript //初始化引擎 Laya.init(1136,640); var txt = new Laya.Text(); //设置文本内容 txt.text = "hello_world"; //设置文本颜色 txt.color = "#ffffff"; Laya.stage.addChild(txt); ``` 这个时候我们就可以看到txt已经添加到舞台上了,...

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

12. 用native打包后输入框聚焦时,文本的位置有偏移 [ 74%]

...的代码上,因为我们是自己做的屏幕适配,在设计分辨率1136*640下,如果机型的屏幕分辨率的高宽比大于1136/640的情况下,会使stage有一个Y方向的偏移来达到居中的效果,引擎代码在计算输入框光标坐标的时候,这个Y方向的偏移...

来源: Laya_社区 发布时间: 20201125

13. Sprite-遮罩-放大镜 [ 74%]

...var bg2; (function() { // 不支持WebGL时自动切换至Canvas Laya.init(1136, 640, WebGL); Laya.stage.alignV = Stage.ALIGN_MIDDLE; Laya.stage.alignH = Stage.ALIGN_CENTER; Laya.stage.scaleMode = "showall"; Laya.stage.bgColor = "#232628"; Laya.loader.load("../../res/bg2.png", Handler.create(this, s...

来源: Laya_示例 发布时间: 20260106

14. 手机游戏,一般做多大分辨率的呀?? [ 74%]

...一半,为320*480,请问怎么解决? 有个需求,pc分辨率为1136x640,手机上分辨率为640x1136,这个要怎么实现? 如何获得浏览器的窗口分辨率 不同手机分辨率怎么适配 怎么根据分辨率加载不同资源 咨询一下.laya的分辨率为什么和物...

来源: Laya_社区 发布时间: 20160816

15. 文本基础样式(ActionScript-LayaAir基础篇(AS3)-文本) [ 74%]

...ss LayaSample { public function LayaSample() { //初始化引擎 Laya.init(1136, 640); var txt:Text = new Text(); txt.text = "hello_world"; txt.color = "#ffffff"; Laya.stage.addChild(txt); } } } ``` 这个时候我们就可以看到txt已经添加到舞台上了,显示了txt中 白色的hello_worl...

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

16. 设置遮罩(ActionScript-LayaAir基础篇(AS3)-位图) [ 72%]

...Res:String; private var img:Sprite; public function MaskDemo() { Laya.init(1136,640); //设置舞台背景色 Laya.stage.bgColor = "#ffffff" //资源路径 Res = "res/img/monkey1.png"; //先加载图片资源,在图片资源加载成功后,通过回调方法绘制图片并添加到舞台 Laya.lo...

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

17. 文本对齐与自动换行(JavaScript-LayaAir基础篇(JS)-文本) [ 71%]

...直对齐将不会有效果。 ```javascript //初始化引擎 Laya.init(1136,640); var txt = new Laya.Text(); //设置文本内容 txt.text = "hello_world"; //设置文本区背景 txt.bgColor = "#c30c30"; //设置文本的宽高 txt.width = 400; txt.height = 400; //设置文本水平居中 txt.ali...

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

18. 请问引擎中是否支持类似Flash中擦除效果 BlendMode.ERASE [ 71%]

...会变为方块。是使用WebGL是正常的。 不使用WebGL Laya.init(1136, 640)   使用WebGL Laya.init(1136, 640, WebGL);   2017-01-21 0 0 分享 微博 QZONE 微信 wyg3732630 赞同来自: webGl 下 blendMode = "destination-out";出现黑块的问题 需要怎么解决?   2017-12-22 0 1 ...

来源: Laya_社区 发布时间: 20170120

19. 文本对齐与自动换行(ActionScript-LayaAir基础篇(AS3)-文本) [ 70%]

...ss LayaSample { public function LayaSample() { //初始化引擎 Laya.init(1136,640); var txt:Text = new Text(); //设置文本内容 txt.text = "hello_world"; //设置文本区背景 txt.bgColor = "#c30c30"; //设置文本的宽高 txt.width = 400; txt.height = 400; //设置文本水平居中 txt.a...

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

20. 编译前(AS)和编译后(JavaScript)程序的行为是不一致的,求最佳实践和原理。 [ 68%]

...ss LayaSample { public function LayaSample() { //初始化引擎 Laya.init(1136, 640); var func:Function = new A().method; func(); } } } package { public class A { private var _attr:int = 123; public function A() { } public function method():void { trace(_attr); } } } 2016-12-13 添加评论 免费...

来源: Laya_社区 发布时间: 20161213