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

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

101. 屏幕适配-缩放-Show All [ 90%]

...Color = "#232628"; this.createCantralRect(); } createCantralRect() { const Sprite = Laya.Sprite; this.rect = new Sprite(); this.rect.graphics.drawRect(-100, -100, 200, 200, "gray"); Laya.stage.addChild(this.rect); this.updateRectPos(); } updateRectPos() { this.rect.x = Laya.stage.width / 2; this.rec...

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

102. Sprite-旋转缩放 [ 90%]

...TypeScript三种开发语言、LayaAirIDE让项目开发更高效。class Sprite_RoateAndScale { constructor() { const Browser = Laya.Browser, WebGL = Laya.WebGL, Stage = Laya.Stage; // 不支持WebGL时自动切换至Canvas Laya.init(Browser.clientWidth, Browser.clientHeight, WebGL); Laya.stage.ali...

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

103. 圆不跟谁 sprite 一起缩放? [ 90%]

圆不跟谁 sprite 一起缩放? 在 sprite 上画直线与圆环, 直线能跟随滚轮共同缩放,圆环一直保持大小不变,都是画在同一个 sprite 上,为什么?   import WebGL = Laya.WebGL; import Browser = Laya.Browser; import Point = Geometry.Point;  // 程序入口 ...

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

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

... > 图片的显示是游戏开发基础,本篇从API到示例分别介绍Sprite.loadImage与Graphics.drawTexture两种显示图片的方法。 ## 1、用loadImage方法显示与切换图片 ### 1.1 loadImage API概述 在API文档中搜索laya.display.Sprite,可以找到loadImage()方法,如...

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

105. 射线检测-碰撞器混合 [ 90%]

...url: "../../res/threeDimen/skinModel/LayaMonkey/LayaMonkey.lh", clas: Laya.Sprite3D, priority: 1 } ]; Laya.loader.create(resource, Laya.Handler.create(this, onLoadFinish)); function onLoadFinish() { this.scene = Laya.stage.addChild(Laya.Scene.load("../../res/threeDimen/scene/ColliderScene/ColliderDe...

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

106. 二进制图片(TypeScript-2D进阶篇(TS)-游戏加载策略) [ 90%]

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

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

107. 滤镜的集中实现 [ 90%]

...    /**创建位图方法**/ function createImg(w,h){ var Img = new Laya.Sprite(); //添加到舞台 Laya.stage.addChild(Img); //加载显示图片 Img.loadImage("res/tt.png",w,h); return Img; } /**创建红色滤镜位图方法**/ function creteRedFilter(){ //颜色滤镜矩阵,红色 var colorMa...

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

108. 加载-销毁Texture使用的图片资源 [ 90%]

...Laya.stage.bgColor = "#232628"; Stat.show(); this.init(); } init() { const Sprite = Laya.Sprite, Animation = Laya.Animation, Text = Laya.Text, Event = Laya.Event; // 创建背景 this.spBg = Sprite.fromImage(PathBg); Laya.stage.addChild(this.spBg); // 创建动画 this.aniFly = new Animation(); this...

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

109. Sprite中的width,height和size(width,height)感觉没作用啊 [ 90%]

Sprite中的width,height和size(width,height)感觉没作用啊 我的图片是800*600,懒得修改图片,想在程序中直接修改图片显示大小,可是貌似显示的还是800*600。width,height,size(width,height)是我理解问题,还是我写错了呢。。。。 ...

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

110. 三个图好像无法绑定不同的事件? [ 90%]

...同的事件? Laya.init(400, 400, laya.webgl.WebGL); var img1 = new Laya.Sprite(); img1.loadImage('https://layaair.ldc.layabox.com/demo/h5/res/apes/monkey2.png',100,100,90,90); Laya.stage.addChild(img1); img1.on(Laya.Event.CLICK,this, function(name){ console.log(name);},['图1']); var img2 = new L...

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