Barrage module

Barrage module

Source code introduction: sliding channel selection

plan:

1.

Through bullet screen collision detection, decide whether to use this channel, that is, the channel is judged from top to bottom each time.

The main difficulty of collision detection is to detect the collision between horizontally scrolling bullet screens. The survival time of a bullet screen is determined by its display time and survival length. Therefore, to determine whether there is a collision between bullet screens, it is only necessary to detect whether there is a collision at the beginning and disappearance.

2.

When the first channel cannot be found, check the minimum distance of all channels. This distance must be within the length of the specified first barrage. If found, place it behind the corresponding barrage.

2.1. When the rightmost barrage of the previous barrage has not yet appeared on the screen, the new barrage is placed behind it, and space is the interval between the two

2.2. When the rightmost side of the previous bullet screen has appeared on the screen, the new bullet screen is still placed on the border waiting to be scrolled

Surface channel selection (divided into two rows of channels)

plan:

1.

Select the *** row, and follow the rule that there is no bullet screen. If there is no bullet screen, it will be displayed.

2.

If the first row is full, use the second row, which is half the channel height below the base coordinate y of the first row.

This will create a visual difference. When the first row of displays disappears, the second row can be seen, thus achieving a larger display channel (2n-1).

Test environment: Xcode 6.2, iOS 6.0 or above

Source code renderings:

[[140690]]

Download address: http://download..com/data/2068358

<<:  Multi-style card stacking view--ZLSwipeableViewSwift

>>:  Overview of Mobile Web Development Specifications

Recommend

After grains and vegetables, can we also “ask for food from the forest”?

The autumn breeze brings the fragrance of fruits ...

Mianyang, Sichuan, don’t be so low-key!

I don't know about 1,000 years ago Li Bai, wh...

Advanced Numerology Course: Simple Eight Characters Master Edition

Advanced Numerology Course: Simple Eight Characte...

6 elements, how to trick consumers into placing orders step by step?

Our consumption behavior is 100% controlled. Why ...

iOS 18 new features exposed, finally here!

Generative AI technology is very popular this yea...

Chen Jiangxiong-Douyin Follower Increase and Traffic Training Camp

Chen Jiangxiong's Douyin fan increase and tra...

Watermelons growing in the air? Unlock a new way to grow watermelons!

In the hot summer, what fruits can you eat to coo...

What are the "black and white holes" on the road? You can't just hide from them!

Tunnel entrance and exit sections Why do accident...

These foods have no expiration date, don’t throw them away foolishly!

This article was reviewed by Pa Li Ze, chief phys...