panghaijiao / hjdanmaku-swift Goto Github PK
View Code? Open in Web Editor NEWA high performance danmaku engine for iOS
Home Page: http://www.olinone.com/?p=755
License: MIT License
A high performance danmaku engine for iOS
Home Page: http://www.olinone.com/?p=755
License: MIT License
我尝试了很多次,调用 play() 方法后都会报错 isPrepared
== NO 的错误
guard self.isPrepared else {
assert(false, "isPrepared is NO!")
return
}
您好,想请教,目前在实作动态改变弹幕字的大小,下面是透过slider调整后,透过NotificationCenter触发的func,调整cell大小显示没问题,不过在屏幕上的弹幕准备要移出屏幕时有些奇怪(还没移出屏幕就由右到左逐渐消失),估计是改变frame size导致原本计算好的数值不一致,不知道有沒有refresh目前屏幕上弹幕的方法,谢谢
@objc func danmakuFontSizeChanged(_ notification: Notification) {
guard let rate = notification.object as? Float, rate > 0 else { return }
danmakuView.visibleCells.forEach {
if let model = danmakuView.danmakuForVisibleCell($0) as? danmakuModel {
$0.textLabel.attributedText = NSAttributedString(string: model.danmaku.text, attributes: model.attributes)
if let newWidth = danmakuView.dataSource?.danmakuView(danmakuView, widthForDanmaku: model) {
$0.frame = CGRect(x: $0.frame.origin.x, y: $0.frame.origin.y, width: newWidth, height: $0.frame.size.height )
}
}
}
}
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.