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

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

1901. graphics颜色填充fillColor问题 [ 69%]

...,代码://初始化LayaAIR环境 Laya.init(1000, 800); //创建精灵 var sp:Sprite = new Sprite(); //创建渐变 var gradient=Browser.context.createLinearGradient(0,0,80,0); gradient.addColorStop(0,"white"); gradient.addColorStop(1,"red"); sp.graphics.drawRect(0, 0, 150, 150, gradient); sp.gra...

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

1902. as3的类里定义的字段编译后会被注释 [ 69%]

...注释 AS3中下面的一个简单的数据类 public class Demo { public var a:int; public var b:String; public function Demo() { } }通过编译后会变成下面的代码class Demo{ constructor (){ //this.a=0; //this.b=null; } }这里字段a和b在编译后会被注释掉,只有初始化的时...

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

1903. 切换位图,点击图片距离容器的区域也会触发点击事件 [ 69%]

...liang.png"; //地址 this.img2 = "../laya/assets/comp/haoyuobang-hui.png"; var img = new Laya.Sprite(); //实例 img.width = 300; //宽高 img.height = 200; switchImg(); img.on(Laya.Event.CLICK, this, switchImg) //点击事件 Laya.stage.addChild(img); function switchImg() { img.graphics.clear(); //...

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

1904. 关于多点触控e.touches问题 [ 69%]

...MoveRockerPosX = undefined;    this.ctrlMoveRockerPosY = undefined;    var tX, tY;    var ts = e.touches;    console.log(e.stageX + ":" + e.stageY);    if(ts) {             console.log("11111111111111111111");    }    else {       console.log("33333333333333333333333");    }...

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

1905. 嵌入字体 · LayaAir3.3 · 引擎文档 · LAYABOX [ 69%]

...字体名称“layabox”使用关联字体。 function registerFont() { var assetFontData = conch.readFileFromAsset('font/layabox.ttf', 'raw'); if (assetFontData) { if (conch.registerFont("layabox", assetFontData)) { log('字体注册成功'); } else { log('字体注册失败'); } } } 4.2 方法二...

来源: Laya3.0_文档 发布时间: 20250103

1906. drawTexture时,Matrix对象,a=-1,无法实现水平翻转 [ 69%]

...res/atlas/test0.png", Handler.create(this, function():void    {     var t:Texture = Laya.loader.getRes("res/atlas/test0.png");     ape = new Sprite();     var matrix:Matrix = new Matrix();     matrix.a = -1;     matrix.tx = 2*100+ t.width;     ape.graphics.drawTexture(t,10...

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

1907. 分享:LayaAir下如何加载和使用.JSON文件! [ 69%]

...ate(this,onLoaded),null,Loader.JSON); } private function onLoaded():void { var json:JSON=Laya.loader.getRes("unpack.json"); var str:String=JSON.stringify(json); trace(str); } } } 2017-08-07 添加评论 免费帖 --> 分享 微博 QZONE 微信 没有找到相关结果 已邀请: 与内容相关的...

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

1908. 对话框点击空白处真的无法关闭 [ 69%]

... 请帮忙看看我的错误在哪里?谢谢大家   对话框的对象 var SelectColorDialog = (function () { function selectColorDialog() { SelectColorDialog.super(this); this.name = 'SelectColorDialog'; this.x = 1013; } Laya.class(selectColorDialog, "SelectColorDialog", testUI); return selectC...

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

1909. 绘制梯形 出错问题~ [ 69%]

绘制梯形 出错问题~ var path:Array=[["moveTo", 0, 0], //画笔移到A点 ["lineTo", lineW, 0], //画到B点  ["lineTo", dingBianW + (lineW - dingBianW) / 2, -_totalH / Math.sin((90 - Math.abs(skewXNum)) / 180 * Math.PI)], //再画到C点 ["lineTo", (lineW - dingBianW) / 2, -_totalH / Math.s...

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

1910. 角色碰撞器(ActionScript-3D基础(AS3)-LayaAir3D之物理系统) [ 69%]

...=PhysicsWorld_Character)) ```typescript //为精灵添加角色控制器 var character:CharacterController = monkey.addComponent(CharacterController); //创建胶囊碰撞器 var sphereShape:CapsuleColliderShape = new CapsuleColliderShape(1.0, 3.4); //设置Shape的本地偏移 sphereShape.localOf...

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