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

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

271. 文本-HTML文本 [ 70%]

...aya.stage.scaleMode = Stage.SCALE_SHOWALL; Laya.stage.bgColor = "#232628"; this.setup(); } setup() { this.createParagraph(); // 代码创建 this.showExternalHTML(); // 使用外部定义的html } createParagraph() { const HTMLDivElement = Laya.HTMLDivElement; let p = new HTMLDivElement(); Laya.stag...

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

272. UI-ScrollBar [ 70%]

...own.png", "res/ui/vscroll$up.png"); Laya.loader.load(skins, Handler.create(this, this.onSkinLoadComplete)); } onSkinLoadComplete() { this.placeHScroller(); this.placeVScroller(); } placeHScroller() { const HScrollBar = Laya.HScrollBar, Handler = Laya.Handler; let hs = new HScrollBar(); Laya.stage.ad...

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

273. 鼠标交互-Hold [ 70%]

...bgColor = "#232628"; Stat.show(); Laya.loader.load(apePath, Handler.create(this, this.createApe)); } createApe() { const Sprite = Laya.Sprite, Event = Laya.Event; this.ape = new Sprite(); this.ape.loadImage(apePath); let texture = Laya.loader.getRes(apePath); this.ape.pivot(texture.width / 2, textur...

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

274. 文本-位图字体 [ 70%]

...apFont(); bitmapFont.loadFont("../../res/bitmapFont/test.fnt", new Handler(this, onFontLoaded, [bitmapFont])); } function onFontLoaded(bitmapFont) { bitmapFont.setSpaceWidth(10); Text.registerBitmapFont(fontName, bitmapFont); createText(fontName); } function createText(font) { var txt = new Text(); ...

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

275. UI-Label [ 70%]

...aya.stage.scaleMode = Stage.SCALE_SHOWALL; Laya.stage.bgColor = "#232628"; this.setup(); } private setup(): void { this.createLabel("#FFFFFF", null).pos(30, 50); this.createLabel("#00FFFF", null).pos(290, 50); this.createLabel("#FFFF00", "#FFFFFF").pos(30, 100); this.createLabel("#000000", "#FFFFFF"...

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

276. UI-Slider [ 70%]

...", "../../res/ui/vslider$bar.png"); Laya.loader.load(skins, Handler.create(this, onLoadComplete)); })(); function onLoadComplete() { placeHSlider(); placeVSlider(); } function placeHSlider() { var hs = new HSlider(); hs.skin = "../../res/ui/hslider.png"; hs.width = 300; hs.pos(50, 170); hs.min = 0; ...

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

277. 使用typescript开发项目,解决文件引用顺序问题 [ 70%]

...export default class HelloWorld extends Laya.Text { constructor(){ super() this.text = "Hello Layabox" this.color = '#ffffff' } }   2017-11-20 添加评论 免费帖 --> 分享 微博 QZONE 微信 没有找到相关结果 已邀请: 与内容相关的链接 提交 3 个回复 Monica - 知识达人 ...

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

278. 鼠标交互-双指旋转(多点触控) [ 70%]

...(); })(); function setup() { createSprite(); Laya.stage.on(Event.MOUSE_UP, this, onMouseUp); Laya.stage.on(Event.MOUSE_OUT, this, onMouseUp); } function createSprite() { sp = new Sprite(); var w = 200, h = 300; sp.graphics.drawRect(0, 0, w, h, "#FF7F50"); sp.size(w, h); sp.pivot(w / 2, h / 2); sp.po...

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

279. 区块地图-等角地图 [ 70%]

...OWALL; Laya.stage.bgColor = "#232628"; createMap(); Laya.stage.on("click", this, onStageClick); })(); function createMap() { tiledMap = new TiledMap(); tiledMap.createMap("../../res/tiledMap/isometric_grass_and_water.json", new Rectangle(0, 0, Laya.stage.width, Laya.stage.height), Handler.create(thi...

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

280. 网络和格式-XML [ 70%]

...p(); })(); function setup() { var xmlValueContainsError = "item aitem bsomethis..."; var xmlValue = "item aitem bsomethings..."; proessXML(xmlValueContainsError); console.log("\n"); proessXML(xmlValue); } function proessXML(source) { try { var xml = Utils.parseXMLFromString(source); } catch (e) { co...

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