TestsTested | ✗ |
LangLanguage | Obj-CObjective C |
License | MIT |
ReleasedLast Release | Jan 2016 |
Maintained by LeoMobileDeveloper.
LeoDanmakuKit is available through CocoaPods. To install it, simply add the following line to your Podfile:
pod "LeoDanmakuKit"
You can also download the Example project and copy the Class floder into your project
#import "LeoDanmaku.h"
When you add a new danmaku,you first create a LeoDanmakuModel
,for example,you may use the random factory method build in
NSArray * colors = @[[UIColor redColor],[UIColor blueColor],[UIColor greenColor],[UIColor whiteColor]];
LeoDanmkuModel * danmaku = [LeoDanmkuModel randomDanmkuWithColors:colors MaxFontSize:18 MinFontSize:15];
danmaku.text = self.textfiled.text;
Then
[self.danmakuView addDanmaku:danmaku];
When you want the view remove from superview and get dealloced,do not forget to call
[self.danmakuView stop]
You can set the speed and other related property of LeoDanmakuChannelManager
@property (assign,nonatomic)CGFloat maxSpeed;//Default 100 points/s
@property (assign,nonatomic)CGFloat minSpeed;//Default 50 points/s
@property (assign,nonatomic)CGFloat minSpace;//Default 20
@property (assign,nonatomic)CGFloat inverval;//Default 0.25
@property (assign,nonatomic)NSInteger channelsCount;//Number of channels
LeoMobileDeveloper, [email protected]
LeoDanmakuKit is available under the MIT license. See the LICENSE file for more info.