public class DanmakuFactory
extends java.lang.Object
限定符和类型 | 字段和说明 |
---|---|
static float |
BILI_PLAYER_HEIGHT |
static float |
BILI_PLAYER_WIDTH |
static long |
COMMON_DANMAKU_DURATION |
int |
CURRENT_DISP_HEIGHT |
int |
CURRENT_DISP_WIDTH |
static int |
DANMAKU_MEDIUM_TEXTSIZE |
long |
MAX_DANMAKU_DURATION |
static long |
MAX_DANMAKU_DURATION_HIGH_DENSITY |
Duration |
MAX_Duration_Fix_Danmaku |
Duration |
MAX_Duration_Scroll_Danmaku |
Duration |
MAX_Duration_Special_Danmaku |
static long |
MIN_DANMAKU_DURATION |
static float |
OLD_BILI_PLAYER_HEIGHT |
static float |
OLD_BILI_PLAYER_WIDTH |
long |
REAL_DANMAKU_DURATION |
IDisplayer |
sLastDisp |
限定符 | 构造器和说明 |
---|---|
protected |
DanmakuFactory() |
限定符和类型 | 方法和说明 |
---|---|
static DanmakuFactory |
create() |
BaseDanmaku |
createDanmaku(int type) |
BaseDanmaku |
createDanmaku(int type,
DanmakuContext context) |
BaseDanmaku |
createDanmaku(int type,
float viewportWidth,
float viewportHeight,
float viewportSizeFactor,
float scrollSpeedFactor)
创建弹幕数据请尽量使用此方法,参考BiliDanmakuParser或AcfunDanmakuParser
|
BaseDanmaku |
createDanmaku(int type,
IDisplayer disp,
float viewportScale,
float scrollSpeedFactor) |
BaseDanmaku |
createDanmaku(int type,
int viewportWidth,
int viewportHeight,
float viewportScale,
float scrollSpeedFactor)
创建弹幕数据请尽量使用此方法,参考BiliDanmakuParser或AcfunDanmakuParser
|
void |
fillAlphaData(BaseDanmaku item,
int beginAlpha,
int endAlpha,
long alphaDuraion)
Initial alpha data of the special danmaku
|
static void |
fillLinePathData(BaseDanmaku item,
float[][] points,
float scaleX,
float scaleY) |
void |
fillTranslationData(BaseDanmaku item,
float beginX,
float beginY,
float endX,
float endY,
long translationDuration,
long translationStartDelay,
float scaleX,
float scaleY)
Initial translation data of the special danmaku
|
void |
notifyDispSizeChanged(DanmakuContext context) |
void |
resetDurationsData() |
void |
updateDurationFactor(float f) |
void |
updateMaxDanmakuDuration() |
boolean |
updateViewportState(float viewportWidth,
float viewportHeight,
float viewportSizeFactor) |
public static final float OLD_BILI_PLAYER_WIDTH
public static final float BILI_PLAYER_WIDTH
public static final float OLD_BILI_PLAYER_HEIGHT
public static final float BILI_PLAYER_HEIGHT
public static final long COMMON_DANMAKU_DURATION
public static final int DANMAKU_MEDIUM_TEXTSIZE
public static final long MIN_DANMAKU_DURATION
public static final long MAX_DANMAKU_DURATION_HIGH_DENSITY
public int CURRENT_DISP_WIDTH
public int CURRENT_DISP_HEIGHT
public long REAL_DANMAKU_DURATION
public long MAX_DANMAKU_DURATION
public Duration MAX_Duration_Scroll_Danmaku
public Duration MAX_Duration_Fix_Danmaku
public Duration MAX_Duration_Special_Danmaku
public IDisplayer sLastDisp
public static DanmakuFactory create()
public void resetDurationsData()
public void notifyDispSizeChanged(DanmakuContext context)
public BaseDanmaku createDanmaku(int type)
public BaseDanmaku createDanmaku(int type, DanmakuContext context)
public BaseDanmaku createDanmaku(int type, IDisplayer disp, float viewportScale, float scrollSpeedFactor)
public BaseDanmaku createDanmaku(int type, int viewportWidth, int viewportHeight, float viewportScale, float scrollSpeedFactor)
type
- 弹幕类型viewportWidth
- danmakuview宽度,会影响滚动弹幕的存活时间(duration)viewportHeight
- danmakuview高度viewportScale
- 缩放比例,会影响滚动弹幕的存活时间(duration)public BaseDanmaku createDanmaku(int type, float viewportWidth, float viewportHeight, float viewportSizeFactor, float scrollSpeedFactor)
type
- 弹幕类型viewportWidth
- danmakuview宽度,会影响滚动弹幕的存活时间(duration)viewportHeight
- danmakuview高度viewportSizeFactor
- 会影响滚动弹幕的速度/存活时间(duration)public boolean updateViewportState(float viewportWidth, float viewportHeight, float viewportSizeFactor)
public void updateMaxDanmakuDuration()
public void updateDurationFactor(float f)
public void fillTranslationData(BaseDanmaku item, float beginX, float beginY, float endX, float endY, long translationDuration, long translationStartDelay, float scaleX, float scaleY)
item
- beginX
- beginX
- beginY
- endX
- endY
- translationDuration
- translationStartDelay
- public static void fillLinePathData(BaseDanmaku item, float[][] points, float scaleX, float scaleY)
public void fillAlphaData(BaseDanmaku item, int beginAlpha, int endAlpha, long alphaDuraion)
item
- beginAlpha
- endAlpha
- alphaDuraion
-