Giter Site home page Giter Site logo

hjdanmaku-swift's People

Contributors

panghaijiao avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

hjdanmaku-swift's Issues

希望文档可以再完善一点

我尝试了很多次,调用 play() 方法后都会报错 isPrepared == NO 的错误

    guard self.isPrepared else {
        assert(false, "isPrepared is NO!")
        return
    }

动态改变 font size

您好,想请教,目前在实作动态改变弹幕字的大小,下面是透过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 )
                }
            }
        }
    }

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.