本文整理汇总了Java中master.flame.danmaku.danmaku.model.Duration类的典型用法代码示例。如果您正苦于以下问题:Java Duration类的具体用法?Java Duration怎么用?Java Duration使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Duration类属于master.flame.danmaku.danmaku.model包,在下文中一共展示了Duration类的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createDanmaku
import master.flame.danmaku.danmaku.model.Duration; //导入依赖的package包/类
public BaseDanmaku createDanmaku(int type, float viewportWidth, float viewportHeight, float viewportSizeFactor, float scrollSpeedFactor) {
boolean sizeChanged = updateViewportState(viewportWidth, viewportHeight, viewportSizeFactor);
if (this.MAX_Duration_Scroll_Danmaku == null) {
this.MAX_Duration_Scroll_Danmaku = new Duration(this.REAL_DANMAKU_DURATION);
this.MAX_Duration_Scroll_Danmaku.setFactor(scrollSpeedFactor);
} else if (sizeChanged) {
this.MAX_Duration_Scroll_Danmaku.setValue(this.REAL_DANMAKU_DURATION);
}
if (this.MAX_Duration_Fix_Danmaku == null) {
this.MAX_Duration_Fix_Danmaku = new Duration(COMMON_DANMAKU_DURATION);
}
if (sizeChanged && viewportWidth > 0.0f) {
updateMaxDanmakuDuration();
float scaleX = 1.0f;
float scaleY = 1.0f;
if (this.CURRENT_DISP_WIDTH > 0 && this.CURRENT_DISP_HEIGHT > 0) {
scaleX = viewportWidth / ((float) this.CURRENT_DISP_WIDTH);
scaleY = viewportHeight / ((float) this.CURRENT_DISP_HEIGHT);
}
if (viewportHeight > 0.0f) {
updateSpecialDanmakusDate(scaleX, scaleY);
}
}
switch (type) {
case 1:
return new R2LDanmaku(this.MAX_Duration_Scroll_Danmaku);
case 4:
return new FBDanmaku(this.MAX_Duration_Fix_Danmaku);
case 5:
return new FTDanmaku(this.MAX_Duration_Fix_Danmaku);
case 6:
return new L2RDanmaku(this.MAX_Duration_Scroll_Danmaku);
case 7:
BaseDanmaku instance = new SpecialDanmaku();
this.sSpecialDanmakus.addItem(instance);
return instance;
default:
return null;
}
}