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

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

261. websocket请教下,服务器发送过来的数据怎么获取 [ 86%]

websocket请教下,服务器发送过来的数据怎么获取 private openHandler(event: any = null): void { console.log(`平台 正确建立连接`); this.socket.send("getScore"); } private receiveHandler(msg: any = null,data): void { console.log(`接收到数据触发函数:` + msg); ////////////...

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

262. 2D物理-复合碰撞器 [ 86%]

...{ Event } from "laya/events/Event"; export class Physics_Physics_Tumbler { private count = 0; private box: Sprite; private totalBox = 200; private label: Label; Main: typeof Main = null; constructor(maincls: typeof Main) { this.Main = maincls; Laya.Config.isAntialias = true; Laya.init(Browser.client...

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

263. 关于切换图片的问题 [ 86%]

关于切换图片的问题 class Main{ private plane1:string = "res/plane.png"; private plane2:string = "res/untitled.png"; private img: Laya.Sprite; private flag: boolean = false; constructor() { Laya.init(1000,800); this.img = new Laya.Sprite; this.img.loadImage(this.plane1); Laya.stage.addChild...

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

264. LayaBox进阶之UI管理类 [ 86%]

...addChild打开的;     新建一个UIManagerexport class UIManager { private mainContent: Laya.Sprite; private scene: GameScence; private uiList:any; constructor() { this.mainContent = new Laya.Sprite(); this.uiList = ; } }mainContent 为默认添加到的层级, GameScence 为UI管理器默...

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

265. 2D物理-仿生机器人 [ 86%]

...仿生兽 */ export class Physics_Strandbeests { Main: typeof Main = null; private scale = 2.5; private pos: Array = [500, 400]; private m_offset: Array = [0, -80 * this.scale]; private pivot: Array = [0, 8 * this.scale]; private wheel: Sprite; private chassis: Sprite; private motorJoint: RevoluteJo...

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

266. IDE-显示IDE创建的界面 [ 85%]

...his, this.onBtnClick); this.btn2.on(Laya.CLICK, this, this.onBtn2Click); } private onBtnClick(): void { //手动控制组件属性 this.radio.selectedIndex = 1; this.clip.index = 8; this.tab.selectedIndex = 2; this.combobox.selectedIndex = 0; this.check.selected = true; } private onBtn2Click(): void...

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

267. IDE-显示IDE创建的界面 [ 85%]

...his, this.onBtnClick); this.btn2.on(Laya.CLICK, this, this.onBtn2Click); } private onBtnClick(): void { //手动控制组件属性 this.radio.selectedIndex = 1; this.clip.index = 8; this.tab.selectedIndex = 2; this.combobox.selectedIndex = 0; this.check.selected = true; } private onBtn2Click(): void...

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

268. WebSocket通信 · LayaAir3.3 · 引擎文档 · LAYABOX [ 85%]

...ass } = Laya; @regClass() export class WebSocketDemo extends Laya.Script { private socket: Laya.Socket; //组件被启用后执行,例如节点被添加到舞台后 onEnable(): void { this.socket = new Laya.Socket(); // 注册事件监听 this.socket.on(Laya.Event.OPEN, this, this.onSocketOpen); t...

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

269. WebSocket发送与接收数据(TypeScript-LayaAir基础篇(TS)-数据与通信) [ 85%]

...一个Socket实例,声明一个Byte实例: ```typescript class Game { private socket: Laya.Socket; private byte: Laya.Byte; constructor() { //初始化引擎 Laya.init(600, 400, Laya.WebGL); this.byte = new Laya.Byte(); //这里我们采用小端 this.byte.endian = Laya.Byte.LITTLE_ENDIAN; this....

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

270. WebSocket发送与接收数据(ActionScript-LayaAir基础篇(AS3)-数据与通信) [ 85%]

...cket; import laya.utils.Byte; import laya.webgl.WebGL; public class Game { private var socket:Socket; private var byte:Byte; public function Game() { //初始化引擎 Laya.init(600, 400,WebGL);// this.byte = new Byte(); this.byte.endian = Byte.LITTLE_ENDIAN;//这里我们采用小端; this.socket...

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