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

大约有 568 项符合查询结果, 库内数据总量为 30,724 项。 (搜索耗时: 0.0051 秒)

251. 骨骼动画-Spine事件 [ 67%]

...t mFactory, mArmature, mStartX = 400, mStartY = 500, mCurrIndex = 0, mLabelSprite; class Skeleton_SpineEvent { constructor() { const Browser = Laya.Browser, WebGL = Laya.WebGL, Stage = Laya.Stage, Stat = Laya.Stat, Sprite = Laya.Sprite; // 不支持WebGL时自动切换至Canvas Laya.init(Browser.cli...

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

252. Laya截图3D场景相关模型,导致模型透视! [ 67%]

...thographic = true; camera.orthographicVerticalSize = 5; this.effRes = Laya.Sprite3D.load(resUrl); this.effRes.on(Laya.Event.HIERARCHY_LOADED, this, function(){ this.eff1 = scene.addChild( Laya.Sprite3D.instantiate(this.effRes)); this.eff1.transform.position = new Laya.Vector3(0,0,50); this.eff1.tran...

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

253. 鼠标交互-鼠标交互 [ 67%]

...is.createLogger(); } createInteractiveTarget() { const Event = Laya.Event, Sprite = Laya.Sprite; let rect = new Sprite(); rect.graphics.drawRect(0, 0, 200, 200, "#D2691E"); rect.size(200, 200); rect.x = (Laya.stage.width - 200) / 2; rect.y = (Laya.stage.height - 200) / 2; Laya.stage.addChild(rect); ...

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

254. laya中js 如何实现Sprite类继承 [ 67%]

laya中js 如何实现Sprite类继承 求问题解决方法 主文件:a.js    组件文件:Role.js a.js文件代码: this.Role = new Role(); this.RoleMap = new Laya.Sprite(); this.RoleMap.size(Laya.stage.width, Laya.stage.height/2); Laya.stage.addChild(this.RoleMap); this.RoleMap.addChild(t...

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

255. 为什么 Event 事件触发不了? [ 67%]

...什么 Event 事件触发不了? 这是我的代码:  var Block = new Sprite(); Laya.stage.addChild(Block); Block.graphics.drawRect(300, 200, 50, 50, "#000"); Block.pos(300, 100); Block.on(Event.MOUSE_DOWN, this, function() {     console.log(1); });   点击无效,但我给用 Laya.stage.o...

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

256. getimagedata直接调用无法获取有效像素问题 [ 67%]

...取有效像素问题 更新: 在 现在有没有办法把一个display.sprite转存成图片 无意间找到了 答案 getimagedata无法直接使用 1 需要先 c= Laya.stage.drawToCanvas(720,1280, 0,0) 2 然后 调用 t = new Trxture(c); t.getPixels(0,0, 720,1280) 希望官方对这种比较...

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

257. 添加了MouseJoint没有效果 [ 67%]

...  let ropePartTexture = Laya.loader.getRes("test/b1.png"); let ropePart : Sprite = new Sprite(); ropePart.texture = ropePartTexture; ropePart.pos(48*vw,10*vh); ropePart.width = 4*vw; ropePart.height = 10*vh; let boxCollider = new laya.physics.BoxCollider(); boxCollider.width = ropePart.width; boxCo...

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

258. localToGlobal坐标值被写死了?!!! [ 67%]

localToGlobal坐标值被写死了?!!! 对一个sprite本身使用localToGlobal,无论sprite在什么位置,得到的数据都是x = 800,y = 600   DEMO截图见下图   工程为2.x;这个bug在1.x中也存在   附件 : --> testLab.rar 2018-11-20 添加评论 免费帖 --> 分...

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

259. LayaAir开发笔记(1)五十音图连连看 [ 67%]

...会跳转到我的个人网站。// 设定背景 var background = new Laya.Sprite(); background.loadImage("linkgame_back.jpg"); background.cacheAsBitmap = true; Laya.stage.addChild(background); // 设定标题 var title = new laya.display.Text(); title.text = g_game_title; title.font = "Arial"; titl...

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

260. 为什么显示不了 [ 67%]

为什么显示不了 var sp = new Laya.Sprite(); sp.graphics.drawRect(this.mouse_x, this.mouse_y, 10, 10, "#ff0000"); //var htmlC:Laya.HTMLCanvas = sp.drawToCanvas(375,440,0,0).getCanvas().toDataURL(); var htmlCanvas:Laya.HTMLCanvas = sp.drawToCanvas(375,440,0,0); var texture:Laya.Texture = new La...

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