Skip to content

zxx/DanmakuKit

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DanmakuKit

Simple Danmaku Engine for iOS inspired by BarrageRenderer

Usage

初始化

DanmakuRenderer *renderer = [[DanmakuRenderer alloc] init];
renderer.view.frame = CGRectMake(0, 120, 375, 200);
renderer.danmakuVerticalAlignment = DanmakuVerticalAlignmentBottom;
renderer.danmakuMoveDirection = DanmakuMoveDirectionRightToLeft;
[self.view addSubview:renderer.view];
[renderer start];

发弹幕

MyViewModel *viewModel = [MyViewModel new];
viewModel.text = @"text danmaku";
DanmakuSprite *danmaku = [DanmakuSpriteFactory createDanmakuWithViewClass:NSStringFromClass([MyDanmakuView class])
                                                                viewModel:viewModel];
[self.danmakuRender accept:danmaku];

Features

  • 支持弹幕从左到右和从右到左滑动
  • 支持弹幕居上对齐和局下对齐
  • 支持自定义滑动速度
  • 支持自定义弹幕UI
  • 支持弹幕点击

Author

zhudongfang0312@gmail.com

About

Simple Danmaku Engine for iOS

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published