读书人

求教思路-在发动机中增加类似QQ的动态

发布时间: 2012-08-14 10:39:57 作者: rapoo

求教思路-在引擎中增加类似QQ的动态表情聊天
引擎调的DX
大致在三个部位需要显示动态表情
1\表情选择窗
2\聊天记录窗
3\输入框

原客户端只能文字聊天, 欲改成支持的表情的,求教思路,或者可用的原码...



[解决办法]
这个和你用的引擎提供的UI系统有关系吧,和DX什么的没关系。

然后这方面主要是排版的问题,计算文字和图像的位置什么的,大方向不难,但是细节上很繁琐很容易出错。

“动态”这个问题可以用纹理动画来实现。
[解决办法]
把表情放到一张大纹理种,每次更新时候,改变纹理坐标即可例如
<EmotionSet>
<Emotion desc = "笑" id = 0>
<face index = 0 left = 0 right = 0.02 top = 0 bottom = 0.02/>
<face index = 1 left = 0.02 right = 0.04 top = 0 bottom = 0.02/>
<face index = 2 left = 0.04 right = 0.06 top = 0 bottom = 0.02/>
</Emotion>
<Emotion desc = "哭" id = 1>
<face index = 0 left = 0 right = 0.02 top = 0 bottom = 0.02/>
<face index = 1 left = 0.02 right = 0.04 top = 0 bottom = 0.02/>
<face index = 2 left = 0.04 right = 0.06 top = 0 bottom = 0.02/>
</Emotion>
</EmotionSet>
随帧率切换face即可

读书人网 >网络游戏

热点推荐