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

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

251. 区块地图-等角地图 [ 81%]

...s/tiledMap/isometric_grass_and_water.json", new Rectangle(0, 0, Laya.stage.width, Laya.stage.height), Laya.Handler.create(this, this.mapLoaded), null, new Point(1600, 800)); } onStageClick() { let p = new Laya.Point(0, 0); // 通过屏幕坐标来获取选中格子的索引 this.layer.getTilePositio...

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

252. Spine 间隔一段时间卡顿5000毫秒左右,期间GPU占用极高, Demo已上传 [ 81%]

...eleton;  class Main {  constructor() { WebGL.enable(); Laya.init(Browser.width, Browser.height); Stat.show();  //棋子动画 this.genSpine("res/spine/ludo_qizidongzuo.skel", Laya.Handler.create(this, (templet: Laya.SpineTemplet) => {  //模版复用 let y = 400; let unitWidth = Laya.stage.wi...

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

253. 2D物理-碰撞过滤器 [ 81%]

...0,200,100,600,1100,600,1100,200"; } private function createBox(posx, posy, width, height, ratio) { var box = new Sprite(); box.on(Event.MOUSE_DOWN, this, this.mouseDown); Laya.stage.addChild(box); box.pos(posx, posy).size(width * ratio, height * ratio); var rigidbody: RigidBody = box.addComponent(Ri...

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

254. 文本-禁止编辑 [ 81%]

...t = Laya.Stat; // 不支持WebGL时自动切换至Canvas Laya.init(Browser.width, Browser.height, WebGL); Laya.stage.alignV = Stage.ALIGN_MIDDLE; Laya.stage.alignH = Stage.ALIGN_CENTER; Laya.stage.scaleMode = Stage.SCALE_SHOWALL; Laya.stage.bgColor = "#232628"; this.createInput(); } createInput() { ...

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

255. Sprite-容器 [ 81%]

...tion() { // 不支持WebGL时自动切换至Canvas Laya.init(Browser.clientWidth, Browser.clientHeight, WebGL); Laya.stage.alignV = Stage.ALIGN_MIDDLE; Laya.stage.alignH = Stage.ALIGN_CENTER; Laya.stage.scaleMode = "showall"; Laya.stage.bgColor = "#232628"; createApes(); })(); function createApes() ...

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

256. UI-Slider [ 81%]

...r; let hs = new HSlider("res/ui/hslider.png"); Laya.stage.addChild(hs); hs.width = 300; hs.pos(50, 170); hs.min = 0; hs.max = 100; hs.value = 50; hs.tick = 1; hs.changeHandler = new Handler(this, this.onChange); } placeVSlider() { const VSlider = Laya.VSlider, Handler = Laya.Handler; let vs = new VS...

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

257. 计时器-延迟调用 [ 81%]

...= "打开控制台可见该函数仅触发了一次"; text.size(Laya.stage.width, Laya.stage.height); text.wordWrap = true; text.valign = "middle"; text.align = "center"; Laya.stage.addChild(text); } } new Timer_CallLater();module laya { import Stage = Laya.Stage; import Text = Laya.Text; import Bro...

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

258. iphoneX 用微信打开游戏,,做新手引导 抠图有问题,,, [ 81%]

...skArea.alpha = maskAlpha; this.maskArea.graphics.drawRect(0, 0, Laya.stage.width, Laya.stage.height, maskColor); this.guideContainer.addChild(this.maskArea); //绘制一个圆形区域,利用叠加模式,从遮罩区域抠出可交互区 this.interactionArea = new Sprite(); //设置叠加模式 ...

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

259. js环境下使用Loader加载图片在Sprite对象的.on函数无效 [ 81%]

...被触发 //设置背景图片 this.bgimg = new Laya.Sprite(); this.bgimg.width=2*scronw; this.bgimg.height=2*scronh; //加载显示图片,坐标位于0,0 var temptexture=Loader.getRes(pic); if (typeof(temptexture)!="undefined"){ this.bgimg.texture=Loader.getRes(pic) }else{ this.bgimg.loadImage(pi...

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

260. fillTexture使用问题 [ 81%]

...exture时无任何效果。 class Map extends laya.display.Sprite { static width: number = 1188; static height: number = 594; constructor() { super(); Laya.loader.load("res/images/map_01.png", Laya.Handler.create(this, this.bgLoaded)); } bgLoaded(): void { let t: Laya.Texture = Laya.loader.getRes("r...

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