大约有 843 项符合查询结果, 库内数据总量为 30,724 项。 (搜索耗时: 0.0051 秒)
Laya_社区(526) Laya3.0_api(65) Laya2.0_api(62) laya_api(57) Laya2.0_示例(44) Laya_示例(41) Laya2.0_文档(30) Laya3.0_文档(18)
相对屏幕坐标 目前做一款 贪吃蛇游戏。。一个Sprite 上面 加载了 十多张 1024的图片 大地图 地图上有些道具和豆, 因为这个豆或者道具 可能在 几千的像素点上!怎么可以转化成 相对于屏幕的坐标点? 2017-05-04 添加评论 免...
来源: Laya_社区 发布时间: 20170504
...export class TextInputControl extends Laya.Script { //declare owner : Laya.Sprite3D; @property( { type : Laya.TextInput } ) public txtin: Laya.TextInput; constructor() { super(); } /** * 组件被激活后执行,此时所有节点和组件均已创建完毕,此方法只执行一次 */ onAwake():...
来源: Laya3.0_文档 发布时间: 20230629
...啦,我给你看下我的三行代码~ let my_canvas: HTMLCanvas = the_sprite.drawToCanvas(Game_Parameter.game_width, Game_Parameter.game_height, 0, 0); //把精灵绘制到canvas上面let my_texture: Texture = new Texture(my_canvas); //使用htmlCanvas创建Texture let pixels = my_texture.getPixe...
来源: Laya_社区 发布时间: 20170405
....alignV=Stage.ALIGN_TOP; var sp:Sprite=new Sprite(); sp.width=100; sp.height=100; sp.graphics.drawRect(0,0,100,100,"#ff0000"); sp.on(Event.MOUSE_OVER,this,onMouse); ...
来源: Laya_社区 发布时间: 20170920
...用于创建简单网格 注意:这里还不是最终场景中看到的 Sprite3D。 用 createBox 来举例,看下API是如何创建网格的: /** * 创建Box网格。 * @param long 半径 * @param height 垂直层数 * @param width 水平层数 * @return */ static createBox(long: number = 1, ...
来源: Laya3.0_文档 发布时间: 20240624
...ya.stage.bgColor = "#232628"; Stat.show(); this.setup(); } setup() { const Sprite = Laya.Sprite, Tween = Laya.Tween; let terminalX = 200; let characterA = this.createCharacter("res/cartoonCharacters/1.png"); characterA.pivot(46.5, 50); characterA.y = 100; let characterB = this.createCharacter("res/c...
来源: Laya2.0_示例 发布时间: 20240930
...s.tMap.createMap("res/map/map.json",viewRect); // 精灵 var sp = new Laya.Sprite(); sp.graphics.drawRect(0, 0, 100, 100, "#FF0000", "#0000FF", 1) sp.zOrder = 1000; 请问这里如何把精灵添加到地图中?看文档没看明白啊, 其他回答仿写都无效果. 2018-07-21 添加评论 ...
来源: Laya_社区 发布时间: 20180721
...D的fillRect报错 代码如下: Laya.init(1136, 640, WebGL ); var mask :Sprite = new Sprite(); mask.graphics.save(); mask.graphics.drawRect( 0, 0, Laya.stage.width, Laya.stage.height, 0xff0000 ); mask.graphics.restore(); mask.x = 0; mask.y = 0; Laya.stage.addChild( mask ); 麻烦看下是什么...
来源: Laya_社区 发布时间: 20170216
...博 QZONE 微信 王 坤 赞同来自: 原生接口绘制,可以绘制到Sprite上吗? 像spbg.graphics.drawPath一样 2018-06-21 0 1 分享 微博 QZONE 微信 王 坤 赞同来自: 直接绘制到画布上,那不是被前面所有的sprite遮挡了吗? 这个不是我想要的啊 2018-06-2...
来源: Laya_社区 发布时间: 20180615
...定不触发bug var Event = Laya.Event; var Sprite = Laya.Sprite; var Stage = Laya.Stage; var Texture = Laya.Texture; var Browser = Laya.Browser; var Handler = Laya.Handler; var WebGL = Laya.WebGL;...
来源: Laya_社区 发布时间: 20161128