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

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

11. 简单的震屏效果 [ 87%]

...        //随机获取震动方向           dir = Math.random() > .5 ? 1 : -1;         //随机获取X轴移动量           offX = Math.random() * 5 * dir + vibrateObj.x;         //随机获取Y轴移动量           offY = Math....

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

12. 输入设备-贪吃蛇(重力感应) [ 87%]

...food.graphics.drawRect(0, 0, foodSize, foodSize, "#00BFFF"); food.x = Math.random() * Laya.stage.width; food.y = Math.random() * Laya.stage.height; } } class Segment extends Laya.Sprite { constructor(width, height) { super(); this.size(width, height); this.init(); } init() { this.graphics.drawRect(-...

来源: Laya2.0_示例 发布时间: 20251130

13. 3D灯光与阴影 · LayaAir3.3 · 引擎文档 · LAYABOX [ 87%]

...ntLight.addComponent(Laya.PointLightCom); pointLightCom.range = 2.0 + Math.random() * 8.0; pointLightCom.color.setValue(Math.random(), Math.random(), Math.random(), 1); pointLightCom.intensity = 6.0 + Math.random() * 8; moverLights[i] = pointLight; offsets[i] = new Vector3((Math.random() - 0.5) * 10...

来源: Laya3.0_文档 发布时间: 20251010

14. laya.d3.math.RandX [ 86%]

...MethodDefined By  RandX(seed:Array) 创建一个 Rand 实例。 RandX  random():Number 返回[0,1)之间的随机数。 RandX  randomint():Array 通过2x32位的数组,返回64位的随机数。 RandXProperty DetaildefaultRandpropertypublic static var defaultRand:RandX基于时间种子的...

来源: laya_api 发布时间: 20170929

15. laya.d3.math.RandX [ 86%]

...MethodDefined By  RandX(seed:Array) 创建一个 Rand 实例。 RandX  random():Number 返回[0,1)之间的随机数。 RandX  randomint():Array 通过2x32位的数组,返回64位的随机数。 RandXProperty DetaildefaultRandpropertypublic static var defaultRand:RandX基于时间种子的...

来源: Laya2.0_api 发布时间: 20190513

16. 在LayaAir1.7.3beta中使用WebGL渲染下粒子系统像素颜色丢失的问题 [ 85%]

...tartColor=MathUtil.lerp(settings.minStartColor,settings.maxStartColor,Math.random()); particleData.endColor=MathUtil.lerp(settings.minEndColor,settings.maxEndColor,Math.random()); } 改为 if (settings.disableColor){ for (i=0;i < 3;i++){ particleData.startColor=1; particleData.endColor=1; } parti...

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

17. timer无法执行 [ 83%]

...hootBall); }   public shootBall(): void{ //生成空中降落的球 //var random: number = Math.random()*24-7; let ball: Laya.MeshSprite3D = new Laya.MeshSprite3D(Laya.PrimitiveMesh.createSphere(1)); this.scene1.addChild(ball);   ball.transform.position = new Laya.Vector3((Math.random() - 0.5) * 2...

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

18. 为什么会出现报错 ani not found:ufo1_down [ 80%]

...ype === "enemy3"){ // 随机是子弹道具还是医疗包 var type = Math.random() < 0.7 ? 2 : 3; var item = Laya.Pool.getItemByClass("role",Role); // 初始化信息 item.init("ufo" + (type - 1),role.camp,1,1,15,type); // 设置位置 item.pos(role.x,role.y); // 添加到舞台上 Laya.stage.ad...

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

19. 点击区域问题 [ 79%]

...r() {     sp.graphics.clear();     var rc:number = Math.floor(Math.random()*0xffffff);     sp.graphics.drawRect(-50,-100,100,100,"#"+rc); } 这样多包几层,点击区域就会怪怪的,绘制的区域和点击区域不一样,不知道是不是我理解的有问题 2018-01-06 添...

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

20. 为什么会出现报错 ani not found:ufo1_down [ 79%]

...ype === "enemy3"){ // 随机是子弹道具还是医疗包 var type = Math.random() < 0.7 ? 2 : 3; var item = Laya.Pool.getItemByClass("role",Role); // 初始化信息 item.init("ufo" + (type - 1),role.camp,1,1,15,type); // 设置位置 item.pos(role.x,role.y); // 添加到舞台上 Laya.stage.ad...

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