Coder Social home page Coder Social logo

jackjet / openbse Goto Github PK

View Code? Open in Web Editor NEW

This project forked from iamscottxu/openbse

0.0 0.0 0.0 19.19 MB

高性能 JavaScript 弹幕引擎。同屏弹幕1000+ A high-performance JavaScript bullet-screen (danmaku) engine.

Home Page: https://iamscottxu.github.io/openBSE/

License: MIT License

JavaScript 89.02% CSS 0.34% HTML 10.46% GLSL 0.18%

openbse's Introduction

openBSE

GitHub Gitee LICENSE NPM Node.js Package

English Version | wiki | Demo | Docs

高性能 JavaScript 弹幕引擎。同屏弹幕1000+

简介

一个高性能 JavaScript 弹幕引擎,简单易用。支持 CSS3 、 Canvas 2D 、 WebGL 和 SVG 渲染方式。支持顶部、底部、逆向弹幕渲染。使用 Canvas 2D 渲染方式可同屏渲染至少1000条弹幕(可达1600条,与电脑配置有关)。

安装和使用

安装

你可以直接点击这里下载最新发行版本,也可以用以下命令安装NPM包。

> npm install openbse

使用

安装完成后,在 Html 页面引入。

压缩版:

<script src="openBSE.all.min.js"></script>

调试版:

<script src="openBSE.all.js"></script>

添加一个 id 为 BulletScreensDiv 的固定大小的 div 标签用于显示弹幕,并插入以下 JavaScript 代码。

var bulletScreenEngine = new openBSE.BulletScreenEngine(document.getElementById('BulletScreensDiv'));
var _startTime = 5000;
for (var i = 0; i < 10000; i++) {
    bulletScreenEngine.addBulletScreen({
        text: "这是一个长长长长长长长长长长长长长长长长长长长长长长长长的测试(^_^)",
        startTime: _startTime
    });
    _startTime += Math.round(Math.random() * 300);
}
bulletScreenEngine.play();

用浏览器打开网页即可显示弹幕。

详细使用说明请查看 wiki

我有问题

如果有任何问题请写下 issues

我要贡献代码

如果你希望向本项目贡献任何代码,请先阅读 CONTRIBUTING.md

版权声明

这个项目是一个开源项目,遵循 MIT 开源协议。要查看协议,请点击这里

openbse's People

Contributors

iamscottxu avatar dependabot[bot] avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.