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

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

321. 3d场景下面有张2d的图片,当鼠标焦点不在该网页时,2d图片为啥会闪动 [ 88%]

...///////////左右两张背景图             var sprite0:Sprite = new Sprite();             sprite0.loadImage("creatRoom/background_bk.png");             sprite0.pos(0,0 );             sprite0.cacheAsBitmap = true;             Laya.stage.addChildAt(sprite...

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

322. hitArea怎么用 [ 88%]

hitArea怎么用 var container = new Sprite();         container.graphics.drawRect(0,0,640,1136,'#ff0000');         container.size(640,1136)         Laya.stage.addChild(container);                       var bg2Sprite =  new Sprite();         bg2Sprite.graphics.drawRect(...

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

323. 滤镜-模糊滤镜 [ 88%]

..., Handler.create(this, createApe)); })(); function createApe() { var ape = new Sprite(); ape.loadImage(apePath); ape.x = (Laya.stage.width - ape.width) / 2; ape.y = (Laya.stage.height - ape.height) / 2; Laya.stage.addChild(ape); applayFilter(ape); } function applayFilter(ape) { var blurFilter = new ...

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

324. Sprite-缓存为静态图像 [ 88%]

... = "#232628"; Stat.show(); setup(); })(); function setup() { var textBox = new Sprite(); // 随机摆放文本 var text; for (var i = 0; i < 1000; i++) { text = new Text(); text.fontSize = 20; text.text = (Math.random() * 100).toFixed(0); text.rotation = Math.random() * 360; text.color = "#CCCCCC"; ...

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

325. 3D模型除了无法获得款高问题,发现在new Laya.Scene()中无法通过getChildByName获取到对象 [ 88%]

3D模型除了无法获得款高问题,发现在new Laya.Scene()中无法通过getChildByName获取到对象 但是,通过getChildAt 可以获取到对象,另外我希望获取之下的所有子节点应该如何处理?另外在减少对象过程中发现删除其中一个对象后,后续...

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

326. 音频-播放演示 [ 88%]

...c); } function createButton(label) { var w = 110; var h = 40; var button = new Sprite(); button.size(w, h); button.graphics.drawRect(0, 0, w, h, "#FF7F50"); button.graphics.fillText(label, w / 2, 8, "25px SimHei", "#FFFFFF", "center"); Laya.stage.addChild(button); return button; } function onPlayMus...

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

327. Sprite-显示图片 [ 88%]

...owApe(); })(); function showApe() { // 方法1:使用loadImage var ape = new Sprite(); Laya.stage.addChild(ape); ape.loadImage("../../res/apes/monkey3.png"); // 方法2:使用drawTexture Laya.loader.load("../../res/apes/monkey2.png", Handler.create(this, function() { var t = Laya.loader.getRes("...

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

328. 区块地图-滚动地图 [ 88%]

...)(); //创建地图 function createMap() { //创建地图对象 tiledMap = new TiledMap(); mX = mY = 0; //创建地图,适当的时候调用destory销毁地图 tiledMap.createMap("../../res/tiledMap/desert.json", new Rectangle(0, 0, Browser.width, Browser.height), new Handler(this, completeHandler...

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

329. 输入设备-指南针 [ 88%]

...NGE, this, onOrientationChange); } function createCompass() { compassImg = new Sprite(); Laya.stage.addChild(compassImg); compassImg.loadImage(compassImgPath); compassImg.pivot(compassImg.width / 2, compassImg.height / 2); compassImg.pos(Laya.stage.width / 2, 400); } function drawUI() { var canvas =...

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

330. 怎么给从模型生成的地形TerrainMaterial材质??? [ 88%]

....MeshTerrainSprite3D.createFromMesh(terrain, 129, 129)); var terMaterial = new Laya.TerrainMaterial(); terMaterial.diffuseTexture1=new Laya.Texture2D.load("map2.png"); terMaterial.diffuseTexture2=new Laya.Texture2D.load("map2.png"); terMaterial.diffuseTexture3=new Laya.Texture2D.load("map2.png"); te...

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