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

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

171. 2D物理-复合碰撞器 [ 92%]

...让项目开发更高效。class Physics_Physics_Tumbler { constructor() { this.count = 0; this.totalBox = 200; Laya.Config.isAntialias = true; Laya.Laya.init(Laya.Browser.clientWidth, Laya.Browser.clientHeight, Laya.WebGL); Laya.Stat.show(); Laya.Physics.enable({ gravity: 0 }); Laya.PhysicsDebugDra...

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

172. 鼠标交互-拖动 [ 92%]

...bgColor = "#232628"; Stat.show(); Laya.loader.load(ApePath, Handler.create(this, this.setup)); } setup() { this.createApe(); this.showDragRegion(); } createApe() { const Sprite = Laya.Sprite, Event = Laya.Event; this.ape = new Sprite(); this.ape.loadImage(ApePath); Laya.stage.addChild(this.ape); let...

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

173. 加载-单一类型资源加载 [ 92%]

...类型资源 Laya.loader.load("../../res/apes/monkey0.png", Handler.create(this, onAssetLoaded1)); // 加载多张png类型资源 Laya.loader.load( ["../../res/apes/monkey0.png", "../../res/apes/monkey1.png", "../../res/apes/monkey2.png"], Handler.create(this, onAssetLoaded2)); })(); function onAsse...

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

174. 扇形遮罩画不全画了一个很奇怪的形状但是矩形的就没问题。显示效果如下:版本号1.7.10 [ 92%]

...blic function ProcessTimer(size:Size)         {             this.spSize = size;             super();         }                  public static function create(img:Image,size:laya.maths.Size):ProcessTimer         {             var pt:ProcessTime...

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

175. 我想移动容器来实现前进的动画,但是移动不了。这里的y有问题 但是又不知道改成什么 [ 92%]

...all"; Laya.stage.bgColor = "#232628"; showApe(); // Laya.timer.frameLoop(1,this,myLoop) })(); function showApe() { // 方法1:使用loadImage加载背景1 var bg1 = new Sprite(); bg1.loadImage("war/bc.png"); Laya.stage.addChild(bg1);   //加载背景2 var bg2 = new Sprite(); bg2.loadImage("war/bc...

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

176. 分享一下自己的屏幕适配方案 [ 92%]

...ight:number; ImgX:number; ImgY:number; Img:Laya.Image =new Laya.Image(); this.nWidth =this.bg.width; //背景图宽 this.nHeight =this.bg.height;//背景图的高 this.Img.x =0; this.Img.y =0; this.Img.url ="../game/1.png"; Laya.stage.addChild(this.Img); //获取图片初始x y轴坐标 this.ImgX=...

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

177. 粒子-粒子演示2 [ 92%]

..."../../"; Laya.loader.load("res/particles/RadiusMode.part", Handler.create(this, onAssetsLoaded), null, Loader.JSON); })(); function onAssetsLoaded(settings) { sp = new Particle2D(settings); sp.emitter.start(); sp.play(); Laya.stage.addChild(sp); sp.x = Laya.stage.width / 2; sp.y = Laya.stage.height...

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

178. 粒子-粒子演示3 [ 92%]

...../../"; Laya.loader.load("res/particles/particleNew.part", Handler.create(this, onAssetsLoaded), null, Loader.JSON); })(); function onAssetsLoaded(settings) { sp = new Particle2D(settings); sp.emitter.start(); sp.play(); Laya.stage.addChild(sp); sp.x = Laya.stage.width / 2; sp.y = Laya.stage.height...

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

179. UI-CheckBox [ 92%]

...).png", "res/ui/checkbox (6).png"]; Laya.loader.load(skins, Handler.create(this, this.onCheckBoxSkinLoaded)); } onCheckBoxSkinLoaded() { let cb; for (let i = 0; i ; constructor() { // 不支持WebGL时自动切换至Canvas Laya.init(800, 600, WebGL); Laya.stage.alignV = Stage.ALIGN_MIDDLE; Laya.stag...

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

180. 分包后, 资源加载问题 [ 92%]

...添加到舞台显示 Laya.loader.load("js/loading100.js", Handler.create(this, complete), null, Loader.TEXT); } private function complete(data:*):void { trace("ok3") __JS__("window.eval(data)"); //此行报错 var load:* = __JS__('new loading100()'); Laya.stage.addChild(load); trace("loading100..."...

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