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

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

61. 在动画编辑器里怎么设置动画的轴心点啊? [ 72%]

...单张散图的中心点,不过你可以通过程序来设置animation的pivot属性 2017-03-06 0 0 分享 微博 QZONE 微信 youhong168 赞同来自: 可是,那样的话,我在编辑器里制作旋转动画的时候,不能设置轴心点,得不到想要的旋转效果啊。比如,我...

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

62. Sprite-切换纹理 [ 72%]

...ction onAssetsLoaded() { ape = new Sprite(); Laya.stage.addChild(ape); ape.pivot(55, 72); ape.pos(Laya.stage.width / 2, Laya.stage.height / 2); // 显示默认纹理 switchTexture(); ape.on("click", this, switchTexture); } function switchTexture() { var textureUrl = (flag = !flag) ? texture1 : textu...

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

63. Sprite-遮罩-放大镜 [ 72%]

...mask maskSp = new Sprite(); maskSp.loadImage("../../res/mask.png"); maskSp.pivot(50, 50); //设置mask bg2.mask = maskSp; Laya.stage.on("mousemove", this, onMouseMove); } function onMouseMove() { bg2.x = -Laya.stage.mouseX * 2; bg2.y = -Laya.stage.mouseY * 2; maskSp.x = Laya.stage.mouseX; maskSp.y =...

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

64. 鼠标交互-自定义事件 [ 72%]

...ew Sprite(); this.sp.graphics.drawRect(0, 0, 200, 200, "#D2691E"); this.sp.pivot(100, 100); this.sp.x = Laya.stage.width / 2; this.sp.y = Laya.stage.height / 2; this.sp.size(200, 200); Laya.stage.addChild(this.sp); this.sp.on(ROTATE, this, this.onRotate); // 侦听自定义的事件 this.sp.on(Event...

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

65. Matter和Sprite绑定后图片移位问题 [ 72%]

...        ball_skin.scale(50/120, 80/178);         ball_skin.pivot(ball_skin.width / 2, ball_skin.height / 2);         var ball = Matter.Bodies.rectangle(330, 1,50, 80, {         layaSprite: ball_skin, // 绑定一个laya的Sprite, 不能用render.sprite        ...

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

66. Sprite-遮罩-放大镜 [ 71%]

...sk let maskSp = new Sprite(); maskSp.graphics.drawTexture(maskRes); maskSp.pivot(50, 50); // 设置mask bg2.mask = maskSp; Laya.stage.on(Laya.Event.MOUSE_MOVE, this, () => { bg2.x = -Laya.stage.mouseX * 2; bg2.y = -Laya.stage.mouseY * 2; maskSp.x = Laya.stage.mouseX; maskSp.y = Laya.stage.mouseY; })...

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

67. Sprite-切换纹理 [ 71%]

...tr); this.ape = new Laya.Sprite(); Laya.stage.addChild(this.ape); this.ape.pivot(55, 72); this.ape.pos(Laya.stage.width / 2, Laya.stage.height / 2); this.switchTexture(); this.ape.on(Laya.Event.CLICK, this, this.switchTexture); } switchTexture() { let monkey = (this.flag = !this.flag) ? monkey1Res :...

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

68. 图片居中的问题 [ 71%]

... 提交 2 个回复 cuixueying 赞同来自:   请设置图片的中心点pivotX和pivotY为中心位置,即image.width/2,image.height/2,image的宽高需要自己手动设置或者通过getBounds获取。 2016-11-18 0 0 分享 微博 QZONE 微信 shaouXie 赞同来自: var bg = new Laya.Spri...

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

69. sprite的rotation设置的位置不一样,子sprite的方向也不一样 [ 70%]

...ya.Sprite(); var s3 = new Laya.Sprite(); s1.width = 64; s1.height = 64; s1.pivot(32, 32); s1.rotation = 90; s2.addChild(s3); s1.addChild(s2);    var s1 = new Laya.Sprite(); var s2 = new Laya.Sprite(); var s3 = new Laya.Sprite(); s1.width = 64; s1.height = 64; s1.pivot(32, 32); s2.addChild(s3); s1....

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

70. 鼠标交互-拖动 [ 69%]

...; Laya.stage.addChild(ape); var texture = Laya.loader.getRes(ApePath); ape.pivot(texture.width / 2, texture.height / 2); ape.x = Laya.stage.width / 2; ape.y = Laya.stage.height / 2; ape.on(Event.MOUSE_DOWN, this, onStartDrag); } function showDragRegion() { //拖动限制区域 var dragWidthLimit = 3...

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