大约有 352 项符合查询结果, 库内数据总量为 31,560 项。 (搜索耗时: 0.0045 秒)
...习惯继承Sprite会导致报错。 **错误的写法:** ``` package { import laya.display.Sprite; //extends Sprite在LayaAir引擎初始化之前继承会报错 public class HelloLayabox extends Sprite { public function HelloLayabox() { Laya.init(0,0); } } ``` **正确的写法:** ``` package ...
来源: Laya2.0_文档 发布时间: 20191206
...习惯继承Sprite会导致报错。 **错误的写法:** ``` package { import laya.display.Sprite; //extends Sprite在LayaAir引擎初始化之前继承会报错 public class HelloLayabox extends Sprite { public function HelloLayabox() { Laya.init(0,0); } } ``` **正确的写法:** ``` package ...
来源: Laya2.0_文档 发布时间: 20210714
...,默认为true。可下面代码为什么结果是false? module laya { import Stage = Laya.Stage; import Text = Laya.Text; import Browser = Laya.Browser; import WebGL = Laya.WebGL; export class Test { private h1: Laya.Handler; private h2: Laya.Handler; constructor() { // 不支持WebGL时自动切...
来源: Laya_社区 发布时间: 20171221
...ntainer.addChild(item); } } } 3,加载资源,完成后再加载界面 import WebGL = Laya.WebGL; // 程序入口 class GameMain { constructor() { Laya.init(500, 1000, WebGL); Laya.stage.scaleMode = Laya.Stage.SCALE_FIXED_WIDTH; var resPath = ['res/atlas/comp.atlas']; Laya.loader.load(resPath, n...
来源: Laya_社区 发布时间: 20180810
...monkey.width, monkey.height); } } new Sprite_SwitchTexture();module laya { import Sprite = Laya.Sprite; import Stage = Laya.Stage; import Texture = Laya.Texture; import Handler = Laya.Handler; import Browser= Laya.Browser; import WebGL = Laya.WebGL; export class Sprite_SwitchTexture { private textur...
来源: Laya2.0_示例 发布时间: 20251130
....y = Laya.stage.mouseY; }); } } new Sprite_MagnifyingGlass();module laya { import Sprite = Laya.Sprite; import Stage = Laya.Stage; import Browser = Laya.Browser; import Handler = Laya.Handler; import WebGL = Laya.WebGL; export class Sprite_MagnifyingGlass { private maskSp:Sprite; private bg2:Sprite;...
来源: Laya2.0_示例 发布时间: 20251130
...功能。我们写个简单的例子来看下用法: ```java package { import laya.events.Event; import laya.net.HttpRequest; public class LayaSample { public function LayaSample() { //初始化引擎 Laya.init(1136, 640); var xhr:HttpRequest = new HttpRequest(); xhr.http.timeout = 10000;//设置...
来源: Laya2.0_文档 发布时间: 20210715
...age.addChild(this.sprite); } } new TiledMap_IsometricWorld();module laya { import Sprite = Laya.Sprite; import Stage = Laya.Stage; import MapLayer = Laya.MapLayer; import TiledMap = Laya.TiledMap; import Point = Laya.Point; import Rectangle = Laya.Rectangle; import Handler = Laya.Handler; import Web...
来源: Laya2.0_示例 发布时间: 20251130
...I生成代码后,无法获取到Button组件。 生成后的代码: import View=Laya.View; import Dialog=Laya.Dialog; import Scene=Laya.Scene; export module ui { export class AttackUI extends View { public btn_attack:Laya.Button; constructor(){ super()} createChildren():void { super.createChi...
来源: Laya_社区 发布时间: 20180926
...容相关的链接 提交 1 个回复 Laya_Aaron 赞同来自: package { import laya.display.Sprite; import laya.ui.Button; import laya.utils.Browser; import laya.utils.Handler; public class Main { public function Main() { //初始化引擎 Laya.init(500,500);//初始化引擎 var skins:Array = [ "r...
来源: Laya_社区 发布时间: 20180529