大约有 43 项符合查询结果, 库内数据总量为 31,560 项。 (搜索耗时: 0.0034 秒)
...Sprite(); //加载显示图片,坐标位于100,50 img.loadImage("res/img/monkey1.png"); //添加到舞台 Laya.stage.addChild(img); } } } ``` 在示例代码里,“`100,50`”是图片的显示坐标信息。示例代码运行效果如图2-1所示:  (图2-1) ### 1.3 用lo...
来源: Laya2.0_文档 发布时间: 20210715
...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 Laya.Sprite(); img2.loadImage('https://layaair.ldc.layabox.com/demo/h5/res/a...
来源: Laya_社区 发布时间: 20180621
...pe = new Sprite(); Laya.stage.addChild(ape); ape.loadImage("../../res/apes/monkey3.png"); } })(); ``` 在示例代码里,“`100,50`”是图片的显示坐标信息。示例代码运行效果如图2-1所示:  (图2-1) ### 1.3 用loadImage切换图片的示例 切换图片是...
来源: Laya2.0_文档 发布时间: 20210715
...; ape.pos(100,50); Laya.stage.addChild(ape); ape.loadImage("../../res/apes/monkey3.png"); } } } new laya.Sprite_DisplayImage(); ``` 在示例代码里,“`100,50`”是图片的显示坐标信息。示例代码运行效果如图2-1所示:  (图2-1) ### 1.3 用loadImage切...
来源: Laya2.0_文档 发布时间: 20210715
... // 程序入口 class Main{ //需要切换的图片资源路径 private monkey1:string = "res/img/monkey1.png"; private monkey2:string = "res/img/monkey2.png"; //切换状态 private flag:boolean = false; private img:Laya.Sprite; constructor() { //初始化引擎 Laya.init(1334,75...
来源: Laya_社区 发布时间: 20180226
... extends Laya.Script { onAwake(): void { this.loadTexture("resources/image/monkey2.png", 500);//需要在resources/image放入相应的资源 this.loadTexture("https://layaair.com/3.x/demo/resources/res/apes/monkey2.png"); } /**加载并显示图片 */ loadTexture(url: string, x: number = 0, y: numb...
来源: Laya3.0_文档 发布时间: 20251010
...画状态设置 isliooping属性为true** ```typescript //获取精灵 var monkey = Laya.Loader.getRes("res/threeDimen/skinModel/LayaMonkey/LayaMonkey.lh"); this.scene.addChild(monkey); //获取角色动画组件 var ani = monkey.getChildAt(0).getComponent(Laya.Animator); //创建一个动画动作...
来源: Laya2.0_文档 发布时间: 20210715
...台背景色 Laya.stage.bgColor = "#ffffff" //资源路径 Res = "res/img/monkey1.png"; //先加载图片资源,在图片资源加载成功后,通过回调方法绘制图片并添加到舞台 Laya.loader.load(Res,Handler.create(this,graphicsImg)); } private function graphicsImg():void { img = ne...
来源: Laya2.0_文档 发布时间: 20210714
...画状态设置 isliooping属性为true** ```typescript //获取精灵 var monkey = Laya.Loader.getRes("res/threeDimen/skinModel/LayaMonkey/LayaMonkey.lh") as Laya.Sprite3D; this.scene.addChild(monkey); //获取角色动画组件 var ani = monkey.getChildAt(0).getComponent(Laya.Animator) as Laya.Ani...
来源: Laya2.0_文档 发布时间: 20210715
...画状态设置 isliooping属性为true** ```typescript //获取精灵 var monkey:Sprite3D = Loader.getRes("res/threeDimen/skinModel/LayaMonkey/LayaMonkey.lh"); scene.addChild(monkey); //获取角色动画组件 var ani:Animator = monkey.getChildAt(0).getComponent(Animator); //创建一个动画动...
来源: Laya2.0_文档 发布时间: 20210715