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

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

181. Sprite-缓存为静态图像 [ 80%]

...x.cacheAsBitmap = true; Laya.stage.addChild(textBox); } })();module laya { import Sprite = Laya.Sprite; import Stage = Laya.Stage; import Text = Laya.Text; import Stat = Laya.Stat; import WebGL = Laya.WebGL; export class Sprite_Cache { constructor() { // 不支持WebGL时自动切换至Canvas Laya.i...

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

182. Web Storage数据存储(ActionScript-LayaAir基础篇(AS3)-数据与通信) [ 80%]

...简单的例子来看下它是如何使用的。 ```javascript package { import laya.net.LocalStorage; import laya.utils.Browser; public class LayaSample { public function LayaSample() { Laya.init(100,100); LocalStorage.setItem("key","hello"); LocalStorage.setItem("data","hello"); var data:Object = ...

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

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

...明一个Socket的实例,声明一个Byte的实例: ```java package { import laya.events.Event; import laya.net.Socket; 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,...

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

184. 鼠标交互-自定义事件 [ 80%]

...sp, { "rotation": newAngle }, 1000, Ease.elasticOut); } })();module laya { import Sprite = Laya.Sprite; import Stage = Laya.Stage; import Event = Laya.Event; import Browser = Laya.Browser; import Ease = Laya.Ease; import Tween = Laya.Tween; import WebGL = Laya.WebGL; export class Interaction_CustomE...

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

185. Sprite-旋转缩放 [ 80%]

...h.sin(scaleDelta); ape.scale(scaleValue, scaleValue); } })();module laya { import Sprite = Laya.Sprite; import Stage = Laya.Stage; import Event = Laya.Event; import Browser = Laya.Browser; import WebGL = Laya.WebGL; export class Sprite_RoateAndScale { private ape: Sprite; private scaleDelta: number ...

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

186. UI-Image [ 80%]

...; dialog.pos(165, 62.5); Laya.stage.addChild(dialog); } })();module laya { import Stage = Laya.Stage; import Image = Laya.Image; import WebGL = Laya.WebGL; export class UI_Image { constructor() { // 不支持WebGL时自动切换至Canvas Laya.init(550, 400, WebGL); Laya.stage.alignV = Stage.ALIGN_MI...

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

187. 性能测试-虫子(慎入) [ 80%]

....pos(x, y); } tick += 0.1; } } new PerformanceTest_Maggots();module laya { import Sprite = Laya.Sprite; import Browser = Laya.Browser; import Handler = Laya.Handler; import Stat = Laya.Stat; import Rectangle = Laya.Rectangle; import WebGL = Laya.WebGL; export class PerformanceTest_Maggots { private ...

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

188. 文本-位图字体 [ 80%]

....height - txt.height >> 1); Laya.stage.addChild(txt); } })();module laya { import BitmapFont = Laya.BitmapFont; import Stage = Laya.Stage; import Text = Laya.Text; import Browser = Laya.Browser; import Handler = Laya.Handler; import WebGL = Laya.WebGL; export class Text_BitmapFont { private fontName...

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

189. 文本-单行输入 [ 80%]

...utText.fontSize = 20; Laya.stage.addChild(inputText); } })();module laya { import Input = Laya.Input; import Stage = Laya.Stage; import Browser = Laya.Browser; import WebGL = Laya.WebGL; export class Text_InputSingleline { constructor() { // 不支持WebGL时自动切换至Canvas Laya.init(Browser.c...

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

190. AS版本生成的js中出现了this.Buffer() [ 80%]

...) 请问2.0的版本开始,我用ts编写的相关内容,都要使用import和export吗? 版本不匹配! 全局 tsc (2.2.2) != VS Code 的语言服务(2.1.5)。可能出现不一致的编译错误 laya2的Scene默认是文件模式,不会生成场景类了,此时该如何获得场景内...

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