1
RIcter 2015-07-26 00:46:31 +08:00
oh,膜拜石头大神_(:3」∠)_
66666 |
2
pandada8 2015-07-26 00:48:11 +08:00
oh,膜拜石头大神和Ricter菊苣_(:3」∠)_
66666 |
3
yaqink 2015-07-26 01:28:47 +08:00 via iPad
oh,膜拜 石头大神 和 Ricter 菊苣 和 pandada _(:3」∠)_
66666 |
4
msg7086 2015-07-26 01:40:05 +08:00
oh,膜拜楼上各路大神菊苣_(:з」∠)_
prprp |
5
kawaiiushio 2015-07-26 04:09:09 +08:00 via iPhone
oh,膜拜石头大神和Ricter菊苣_(:3」∠)_
66666 |
6
KexyBiscuit 2015-07-26 04:44:22 +08:00 via Android
oh,膜拜石头大神、Ricter 菊苣、pandada 大触、yaqink 和 msg7086 _(:3」∠)_
prprpr |
7
pimin 2015-07-26 06:19:58 +08:00
我就想知道这个东西单纯幻想出来的,还是真的放在上面地方用过
|
8
Epsil0n9 2015-07-26 08:28:26 +08:00
oh,膜拜石头大神、Ricter 菊苣、pandada 大触、yaqink 、 msg7086 和 KexyBiscuit 师傅 _(:3」∠)_
prprp |
9
zsx 2015-07-26 10:10:16 +08:00
orz一下楼上诸位(虽然都不认识)_(:з」∠)_
https://github.com/zsxsoft/danmu-client https://github.com/zsxsoft/danmu-server 然后默默拿出了自己基于Nodejs + Nwjs的弹幕客户端 + 服务端实现_(:з」∠)_ |
10
molinxx 2015-07-26 10:52:14 +08:00 via iPhone
oh,膜拜上路各种被prpr的各种大神菊苣大触师傅!
prprprpr |
11
lakechan96 OP @zsx 感觉自己的这个效率还是不够好,请教一下您这个大概的弹幕渲染思路和资源管理方面大致是怎么样的?
|
12
zsx 2015-07-27 08:56:09 +08:00
@lakechan96
```javascript DD.CommentFrame.prototype.render = function() { this.ctx.clearRect(0, 0, this.width, this.height); //清空结果画布 var bufCanvasCtx = this.bufCanvas.getContext("2d"); bufCanvasCtx.clearRect(0, 0, this.width, this.height); //清空buffer画布 //渲染各层精灵到buffer画布上 for (var i = 0; i < this.layers.length; i++) { for (var j = 0; j < this.layers[i].length; j++) { this.layers[i][j].draw(bufCanvasCtx); } } //往主图层上绘制buffer图层 this.ctx.drawImage(this.bufCanvas, 0, 0); }; ``` ```javascript (function animate() { that.updateSprite(); //更新Sprite that.clearSprite(); //清除无效Sprite that.render(); that.fps = that.countFps(); // 计算FPS that.renderTimer = window.requestAnimationFrame(animate, that); //console.log(that.renderTimer); })(); ``` |
13
zsx 2015-07-27 08:59:16 +08:00
@lakechan96 不过这块弹幕部分不是我写的_(:з」∠)_ 源自另外一个开源项目,对其进行了改造而已……
|
14
lakechan96 OP 感谢w
|
15
grzhan 2015-08-12 20:39:43 +08:00
已star √
|
16
mikangchan 2015-09-20 16:24:24 +08:00
orz 膜拜楼上菊苣
|