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

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

561. 显示与切换图片(TypeScript-LayaAir基础篇(TS)-位图) [ 83%]

...} private showApe(): void { // 方法1:使用loadImage var ape: Sprite = new Sprite(); ape.pos(100,50); Laya.stage.addChild(ape); ape.loadImage("../../res/apes/monkey3.png"); } } } new laya.Sprite_DisplayImage(); ``` 在示例代码里,“`100,50`”是图片的显示坐标信息。示例代码...

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

562. matterjs渲染laya的ui [ 83%]

....Matter.Bodies.circle(200, 200, 120); //自己定义的ui let layaSprite = new MatterSprite(); //对齐 layaSprite.anchorX = layaSprite.anchorY = 0.5; //背景色 layaSprite.graphics.drawCircle(120, 120, 120, '#ffffff'); ball.layaSprite = layaSprite; 2018-04-23 添加评论 免费帖 --> 分享 微...

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

563. 微信小游戏加云开发,项目怎样配置 [ 83%]

...ui.js:  TypeError: Class constructor Component cannot be invoked without 'new'     at new Widget (laya.ui.js:201)     at laya.ui.js:349     at laya.ui.js:1     at wrapFn (gameContext?id=1:51)     at require (VM37 WAGameSubContext.js:2)     at VM37 WAGameSubContext.js:2     at index.js...

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

564. 用最新版本的IDE开发,用AS语言开发,用HttpRequest加载图片报错,用JS语言开发却可以加载 [ 83%]

...ion LayaSample() { //初始化引擎 Laya.init(1136, 640); var sp:Sprite = new Sprite(); var xhr:HttpRequest = new HttpRequest(); xhr.once(Event.COMPLETE,this,completeHandler); xhr.once(Event.ERROR,this,errorHandler); xhr.send("res/monkey2.png","","get","arraybuffer"); } private function completeHan...

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

565. 如何动态绘制自定义模型? [ 83%]

... Array<number>, normalArr: Array<number>) { const verticeArr = new Array<number>(); for (let i = 0; i < vertArr.length; i += 3) { verticeArr.push(vertArr[i], vertArr[i + 1], vertArr[i + 2]); verticeArr.push(normalArr[i], normalArr[i + 1], normalArr[i + 2]); } const vertices = ne...

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

566. setSubPixels画布擦除不掉 [ 83%]

...is._testStatus; // let canvasInfo = this.getCanvasWidthHeight(); let ctx = new Laya.Context(); // let w = canvasInfo.w//tex.width; // let h = canvasInfo.h//tex.height; let w = tex.width; let h = tex.height; ctx.size(w,h); ctx.asBitmap = true; // ctx.clearRect(0,0,w,h); let _targets= ctx['_targets'];...

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

567. 动画-图集动画 [ 83%]

....ATLAS); } createAnimation() { const Animation = Laya.Animation; let ani = new Animation(); Laya.stage.addChild(ani); ani.loadAtlas(aniConfPath); // 加载图集动画 ani.interval = 30; // 设置播放间隔(单位:毫秒) ani.index = 1; // 当前播放索引 ani.play(); // 播放图集动画...

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

568. 帮忙看看Texture类getPixels内存泄漏的问题。 [ 83%]

...ImageHandler)); } private function __loadImageHandler():void { _colorSpr = new Sprite(); _colorTex = Laya.loader.getRes("assets/images/color1.png"); _colorSpr.graphics.drawTexture(_colorTex); _colorSpr.cacheAs = "bitmap"; _colorSpr.pos((1024 - _colorTex.width) >> 1, (768 - _colorTex.height) &g...

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

569. 求HTTP相关的文档或者例子谢谢了 [ 83%]

...  __proto__.checkList=function(){             this.publicloader=new URLLoader();             this.publicloader.dataFormat=/*iflash.net.URLLoaderDataFormat.VARIABLES*/"variables";             this.publicloader.addEventListener(/*iflash.events.Event.COMPLETE*/"complete",BIN...

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

570. Sprite-旋转缩放 [ 82%]

...; Laya.stage.bgColor = "#232628"; this.showApe(); } showApe() { this.ape = new Laya.Sprite(); Laya.stage.addChild(this.ape); this.ape.loadImage("res/apes/monkey2.png"); this.ape.pivot(55, 72); // this.ape.pos( Laya.stage.width / 2, Laya.stage.height / 2); this.ape.x = Laya.stage.width / 2; this.ape....

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