Code Monkey home page Code Monkey logo

hjdanmakudemo's Introduction

GitHub

HJDanmaku is a high performance danmaku engine for iOS. For more details please click here

Overview

Compared to the version 1.0, HJDanmaku 2.0 has better performance, Such as high performance, large concurrent and better fluency. surely, you can customize the cell style according to product requirements. In version 2.0,it provides a new live mode to meet the live scene.

Get the version of swift at here

Fearture

  • [Performance] The average CPU usage for total is less than 5% .
  • [Fluency] The rendering frame rate (FPS) is stable at 60 frames.
  • [Concurrency] Off screen rendering ensures the stability of large concurrent data.

Reference

Dimension 1.0 2.0
Performance ⭐️⭐️⭐️ ⭐️⭐️⭐️⭐️
Fluency ⭐️⭐️⭐️ ⭐️⭐️⭐️⭐️⭐️
Accuracy ⭐️⭐️⭐️⭐️ ⭐️⭐️⭐️
Concurrency ⭐️⭐️ ⭐️⭐️⭐️⭐️⭐️

Installation with CocoaPods

CocoaPods is a dependency manager for Objective-C, which automates and simplifies the process of using 3rd-party libraries in your projects. See the Get Started section for more details.

Podfile

pod 'HJDanmaku', '~> 2.0'

Usage

Live Mode

// init config with mode HJDanmakuModeLive
HJDanmakuConfiguration *config = [[HJDanmakuConfiguration alloc] initWithDanmakuMode:HJDanmakuModeLive];
HJDanmakuView *danmakuView = [[HJDanmakuView alloc] initWithFrame:self.view.bounds configuration:config];

Video Mode

// init config with mode HJDanmakuModeVideo
HJDanmakuConfiguration *config = [[HJDanmakuConfiguration alloc] initWithDanmakuMode:HJDanmakuModeVideo];
HJDanmakuView *danmakuView = [[HJDanmakuView alloc] initWithFrame:self.view.bounds configuration:config];

Send Danmaku

DemoDanmakuModel *danmaku = [[DemoDanmakuModel alloc] initWithType:HJDanmakuTypeLR];
danmaku.text = @"😊😊olinone.com😊😊";
[self.danmakuView sendDanmaku:danmaku forceRender:YES];

Custom style

// register cell class before dequeue
[self.danmakuView registerClass:[DemoDanmakuCell class] forCellReuseIdentifier:@"cell"];

// configure cell with custom style
DemoDanmakuCell *cell = [danmakuView dequeueReusableCellWithIdentifier:@"cell"];
DemoDanmakuModel *model = (DemoDanmakuModel *)danmaku;
cell.textLabel.font = model.textFont;
cell.textLabel.textColor = model.textColor;
cell.textLabel.text = model.text;

History Release

HJDanmaku 1.0 was first released in 2015, You can get it in the folder HJDanmaku1. Surely, for better performance, we recommend the latest version 2.0.

License

HJDanmakuDemo is released under the MIT license. See LICENSE for details. Copyright (c) 2015 olinone.

Sponsor

GitHub

hjdanmakudemo's People

Contributors

c19354837 avatar panghaijiao avatar

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.