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

大约有 51 项符合查询结果, 库内数据总量为 30,786 项。 (搜索耗时: 0.0023 秒)

1. UI-Button [ 100%]

...r; import laya.webgl.WebGL; public class UI_Button { private const COLUMNS:int = 2; private const BUTTON_WIDTH:int = 147; private const BUTTON_HEIGHT:int = 165 / 3; private const HORIZONTAL_SPACING:int = 200; private const VERTICAL_SPACING:int = 100; private var xOffset:int; private var yOffset:int;...

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

2. UI-CheckBox [ 98%]

...port laya.webgl.WebGL; public class UI_CheckBox { private const COL_AMOUNT:int = 2; private const ROW_AMOUNT:int = 3; private const HORIZONTAL_SPACING:int = 200; private const VERTICAL_SPACING:int = 100; private const X_OFFSET:int = 100; private const Y_OFFSET:int = 50; private var skins:Array; publ...

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

3. 性能测试-卡通人物 [ 94%]

....webgl.WebGL; public class PerformanceTest_Cartoon { private var colAmount:int = 100; private var extraSpace:int = 50; private var moveSpeed:int = 2; private var rotateSpeed:int = 2; private var characterGroup:Array; public function PerformanceTest_Cartoon() { // 不支持WebGL时自动切换至Canv...

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

4. 输入设备-贪吃蛇(重力感应) [ 94%]

...游戏开始时有一个食物 this.produceFood(); } initSnake() { const Point = Laya.Point; for (let i = 0; i 0) { let prevSeg = segments[segments.length - 1]; seg.rotation = prevSeg.rotation; let point = seg.getPinPosition(); seg.x = prevSeg.x - point.x; seg.y = prevSeg.y - point.y; } segments.pus...

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

5. UI-Input [ 92%]

...er; import laya.webgl.WebGL; public class UI_Input { private const SPACING:int = 100; private const INPUT_WIDTH:int = 300; private const INPUT_HEIGHT:int = 50; private const Y_OFFSET:int = 50; private var skins:Array; public function UI_Input() { // 不支持WebGL时自动切换至Canvas Laya.init(8...

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

6. UI-RadioGroup [ 92%]

...mport laya.webgl.WebGL; public class UI_RadioGroup { private const SPACING:int = 150; private const X_OFFSET:int = 200; private const Y_OFFSET:int = 200; private var skins:Array; public function UI_RadioGroup() { // 不支持WebGL时自动切换至Canvas Laya.init(800, 600, WebGL); Laya.stage.alignV...

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

7. 鼠标交互-滑动 [ 92%]

...gth / 2; let buttonPosition, beginPosition, endPosition; let button; class Interaction_Swipe { constructor() { const Browser = Laya.Browser, WebGL = Laya.WebGL, Stage = Laya.Stage, Stat = Laya.Stat, Handler = Laya.Handler; // 不支持WebGL时自动切换至Canvas Laya.init(Browser.clientWidth, Brow...

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

8. UI-List [ 91%]

...// 设置数据项为对应图片的路径 var data:Array = []; for (var i:int = 0; i < 10; ++i) { data.push("../../res/ui/listskins/1.jpg"); data.push("../../res/ui/listskins/2.jpg"); data.push("../../res/ui/listskins/3.jpg"); data.push("../../res/ui/listskins/4.jpg"); data.push("../../res/ui/lists...

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

9. 缓动-逐字缓动 [ 89%]

...; for (var i: number = 0, len: number = demoString.length; i > 1; var endY:int = Laya.stage.height / 2 - 50; var demoString:String = "LayaBox"; for (var i:int = 0, len:int = demoString.length; i < len; ++i) { var letterText:Text = createLetter(demoString.charAt(i)); letterText.x = w / len * i + offs...

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

10. UI-Dialog [ 86%]

...port laya.webgl.WebGL; public class UI_Dialog { private const DIALOG_WIDTH:int = 220; private const DIALOG_HEIGHT:int = 275; private const CLOSE_BTN_WIDTH:int = 43; private const CLOSE_BTN_PADDING:int = 5; private var assets:Array; public function UI_Dialog() { // 不支持WebGL时自动切换至Can...

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