你的浏览器禁用了JavaScript, 请开启后刷新浏览器获得更好的体验!
输入关键字进行搜索
搜索:
发现
话题
全文搜索
登录
[]如何在3d场景中添加文字
我在搞一个3d的rpg的demo,需要给人物模型头顶加个名字跟着模型移动动。
没有找到相关结果
已邀请:
与内容相关的链接
提交
2 个回复
ltmking
赞同来自:
//设置其他玩家角色名称跟随角色模型
这后边的代码放到针刷新事件里
ltmking
赞同来自:
/**玩家名称 */
private txtName:Laya.Text;
//场景的相机
public otherGameScene:Laya.Camera;
private _outPos:Laya.Vector3 = new Laya.Vector3();
this.txtName = new Laya.Text();
this.txtName.color = "#FFFFFF";
this.txtName.text = this.playerName;
this.txtName.fontSize = 18;
this.txtName.font = "Arial";
this.txtName.bold = true;
this.txtName.align = "left";
Laya.stage.addChild(this.txtName);
//设置其他玩家角色名称跟随角色模型
var currPosition2:Laya.Vector3 = new Laya.Vector3(this._position.x, 5, this._position.z);
this.otherGameScene.viewport.project(currPosition2,this.otherGameScene.projectionViewMatrix,this._outPos);
this.txtName.pos(this._outPos.x / Laya.stage.clientScaleX - this.txtName.width/2, this._outPos.y / Laya.stage.clientScaleY);
要回复问题请先
登录
发起人
jzcl2839
相关问题
2.0一不小心删了bin目录下的某个场景json文件。。竟然无法自动生成了?
有什么容器能够实现当子元素达到显示上限后自动滚屏,使得新添加的元素始终保持在最底部显示?
从unity导出的场景透贴和模型烘焙的灯光不显示,请问有知道是什么原因的吗?~~~~~~~~~~~~~
laya2的Scene默认是文件模式,不会生成场景类了,此时该如何获得场景内的元素
laya2.0加载3d场景报错Uncaught TypeError: Cannot read property 'btCollisionObject' of undefined
2.2.0beta4 发布微信小游戏,安卓设备加载场景黑屏
Unity场景使用Laya导出插件导出,总是提示LayaAir3D UnityPlugin: unknown Shader Please use LayaAir3D shader
layaair3.1.3版本打出的项目中的text与label组件在vivo小游戏引擎1105及以下文字显示异常
unity导出的场景不显示实时阴影
我这样载入场景问题出现在哪呢??
3d项目-unity添加物理组件 layanative2 打包android平台 报错 btCollisionObject undefined
问题状态
最新活动:
2017-10-10 14:30
浏览:
2463
关注:
2
人
商务合作
2 个回复
ltmking
赞同来自:
这后边的代码放到针刷新事件里
ltmking
赞同来自:
private txtName:Laya.Text;
//场景的相机
public otherGameScene:Laya.Camera;
private _outPos:Laya.Vector3 = new Laya.Vector3();
this.txtName = new Laya.Text();
this.txtName.color = "#FFFFFF";
this.txtName.text = this.playerName;
this.txtName.fontSize = 18;
this.txtName.font = "Arial";
this.txtName.bold = true;
this.txtName.align = "left";
Laya.stage.addChild(this.txtName);
//设置其他玩家角色名称跟随角色模型
var currPosition2:Laya.Vector3 = new Laya.Vector3(this._position.x, 5, this._position.z);
this.otherGameScene.viewport.project(currPosition2,this.otherGameScene.projectionViewMatrix,this._outPos);
this.txtName.pos(this._outPos.x / Laya.stage.clientScaleX - this.txtName.width/2, this._outPos.y / Laya.stage.clientScaleY);