Skip to content

FrankCheungDev/canvas-barrage

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 

Repository files navigation

canvas-barrage

弹幕插件,可配置多行

在window上定义了canvasBarrage方法

调用方法:

canvasBarrage(oCanvas, aBarrage[,option]);

/** *

  • @param {object, string} oCanvas
  • @param {array} aBarrage
  • @param {object} option
  • option = {
  • multiLine: boolean, 是否多行
  • diffSpeed: boolean, 是否每条弹幕不同速度
  • speed: number, 定义速度
  • interval: number, 每条弹幕间隔
  • colorArr: array, 弹幕颜色数组
  • fontSize: number 弹幕字号
  • } */

default-option:

{
    multiLine: false,
    diffSpeed: false,
    speed: 1,
    interval: fontSize *5,
    colorArr:  ['red', 'skyblue', 'yellow', 'orange'] ,
    fontSize: canvas.clientWidth / 30
 }

About

弹幕插件,可配置多行、速度、颜色等

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published