本文整理汇总了Java中master.flame.danmaku.danmaku.model.AlphaValue.MAX属性的典型用法代码示例。如果您正苦于以下问题:Java AlphaValue.MAX属性的具体用法?Java AlphaValue.MAX怎么用?Java AlphaValue.MAX使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类master.flame.danmaku.danmaku.model.AlphaValue
的用法示例。
在下文中一共展示了AlphaValue.MAX属性的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setDanmakuTransparency
public DanmakuContext setDanmakuTransparency(float p) {
int newTransparency = (int) (((float) AlphaValue.MAX) * p);
if (newTransparency != this.transparency) {
this.transparency = newTransparency;
this.mDisplayer.setTransparency(newTransparency);
notifyConfigureChanged(DanmakuConfigTag.TRANSPARENCY, Float.valueOf(p));
}
return this;
}
示例2: setDanmakuTransparency
public DanmakuContext setDanmakuTransparency(float p) {
int newTransparency = (int) (p * AlphaValue.MAX);
if (newTransparency != transparency) {
transparency = newTransparency;
mDisplayer.setTransparency(newTransparency);
notifyConfigureChanged(DanmakuConfigTag.TRANSPARENCY, p);
}
return this;
}
示例3: setDanmakuTransparency
public DanmakuGlobalConfig setDanmakuTransparency(float p) {
int newTransparency = (int) (p * AlphaValue.MAX);
if (newTransparency != transparency) {
transparency = newTransparency;
isTranslucent = (newTransparency != AlphaValue.MAX);
notifyConfigureChanged(DanmakuConfigTag.TRANSPARENCY, p);
}
return this;
}
示例4: setTransparency
public void setTransparency(int newTransparency) {
this.isTranslucent = newTransparency != AlphaValue.MAX;
this.transparency = newTransparency;
}
示例5: draw
public int draw(BaseDanmaku danmaku) {
float top = danmaku.getTop();
float left = danmaku.getLeft();
if (this.canvas == null) {
return 0;
}
Paint alphaPaint = null;
boolean needRestore = false;
if (danmaku.getType() == 7) {
if (danmaku.getAlpha() == AlphaValue.TRANSPARENT) {
return 0;
}
if (!(danmaku.rotationZ == 0.0f && danmaku.rotationY == 0.0f)) {
saveCanvas(danmaku, this.canvas, left, top);
needRestore = true;
}
if (danmaku.getAlpha() != AlphaValue.MAX) {
alphaPaint = this.ALPHA_PAINT;
alphaPaint.setAlpha(danmaku.getAlpha());
}
}
if (alphaPaint != null && alphaPaint.getAlpha() == AlphaValue.TRANSPARENT) {
return 0;
}
boolean cacheDrawn = false;
int result = 1;
if (danmaku.hasDrawingCache() && danmaku.cache != null) {
DrawingCacheHolder holder = ((DrawingCache) danmaku.cache).get();
if (holder != null) {
cacheDrawn = holder.draw(this.canvas, left, top, alphaPaint);
}
}
if (!cacheDrawn) {
if (alphaPaint != null) {
this.PAINT.setAlpha(alphaPaint.getAlpha());
} else {
resetPaintAlpha(this.PAINT);
}
drawDanmaku(danmaku, this.canvas, left, top, false);
result = 2;
}
if (danmaku.isClickZan) {
this.sStuffer.drawClickBg(danmaku, this.canvas, left, top);
}
if (needRestore) {
restoreCanvas(this.canvas);
}
return result;
}
示例6: resetPaintAlpha
private void resetPaintAlpha(Paint paint) {
if (paint.getAlpha() != AlphaValue.MAX) {
paint.setAlpha(AlphaValue.MAX);
}
}
示例7: setTransparency
@Override
public void setTransparency(int newTransparency) {
isTranslucent = (newTransparency != AlphaValue.MAX);
transparency = newTransparency;
}
示例8: draw
@Override
public int draw(BaseDanmaku danmaku) {
float top = danmaku.getTop();
float left = danmaku.getLeft();
if (canvas != null) {
Paint alphaPaint = null;
boolean needRestore = false;
if (danmaku.getType() == BaseDanmaku.TYPE_SPECIAL) {
if (danmaku.getAlpha() == AlphaValue.TRANSPARENT) {
return IRenderer.NOTHING_RENDERING;
}
if (danmaku.rotationZ != 0 || danmaku.rotationY != 0) {
saveCanvas(danmaku, canvas, left, top);
needRestore = true;
}
int alpha = danmaku.getAlpha();
if (alpha != AlphaValue.MAX) {
alphaPaint = ALPHA_PAINT;
alphaPaint.setAlpha(danmaku.getAlpha());
}
}
// skip drawing when danmaku is transparent
if (alphaPaint != null && alphaPaint.getAlpha() == AlphaValue.TRANSPARENT) {
return IRenderer.NOTHING_RENDERING;
}
// drawing cache
boolean cacheDrawn = false;
int result = IRenderer.CACHE_RENDERING;
if (danmaku.hasDrawingCache()) {
DrawingCacheHolder holder = ((DrawingCache) danmaku.cache).get();
if (holder != null) {
cacheDrawn = holder.draw(canvas, left, top, alphaPaint);
}
}
if (!cacheDrawn) {
if (alphaPaint != null) {
PAINT.setAlpha(alphaPaint.getAlpha());
} else {
resetPaintAlpha(PAINT);
}
drawDanmaku(danmaku, canvas, left, top, false);
result = IRenderer.TEXT_RENDERING;
}
if (needRestore) {
restoreCanvas(canvas);
}
return result;
}
return IRenderer.NOTHING_RENDERING;
}
示例9: draw
@Override
public int draw(BaseDanmaku danmaku) {
float top = danmaku.getTop();
float left = danmaku.getLeft();
if (canvas != null) {
Paint alphaPaint = null;
boolean needRestore = false;
if (danmaku.getType() == BaseDanmaku.TYPE_SPECIAL) {
if (danmaku.getAlpha() == AlphaValue.TRANSPARENT) {
return IRenderer.NOTHING_RENDERING;
}
if (danmaku.rotationZ != 0 || danmaku.rotationY != 0) {
saveCanvas(danmaku, canvas, left, top);
needRestore = true;
}
int alpha = danmaku.getAlpha();
if (alpha != AlphaValue.MAX) {
alphaPaint = ALPHA_PAINT;
alphaPaint.setAlpha(danmaku.getAlpha());
}
}
// skip drawing when danmaku is transparent
if (alphaPaint != null && alphaPaint.getAlpha() == AlphaValue.TRANSPARENT) {
return IRenderer.NOTHING_RENDERING;
}
// drawing cache
boolean cacheDrawn = false;
int result = IRenderer.CACHE_RENDERING;
IDrawingCache<?> cache = danmaku.getDrawingCache();
if (cache != null) {
DrawingCacheHolder holder = (DrawingCacheHolder) cache.get();
if (holder != null) {
cacheDrawn = holder.draw(canvas, left, top, alphaPaint);
}
}
if (!cacheDrawn) {
if (alphaPaint != null) {
PAINT.setAlpha(alphaPaint.getAlpha());
} else {
resetPaintAlpha(PAINT);
}
drawDanmaku(danmaku, canvas, left, top, false);
result = IRenderer.TEXT_RENDERING;
}
if (needRestore) {
restoreCanvas(canvas);
}
return result;
}
return IRenderer.NOTHING_RENDERING;
}
示例10: draw
@Override
public int draw(BaseDanmaku danmaku) {
float top = danmaku.getTop();
float left = danmaku.getLeft();
if (canvas != null) {
Paint alphaPaint = null;
boolean needRestore = false;
if (danmaku.getType() == BaseDanmaku.TYPE_SPECIAL) {
if (danmaku.getAlpha() == AlphaValue.TRANSPARENT) {
return IRenderer.NOTHING_RENDERING;
}
if (danmaku.rotationZ != 0 || danmaku.rotationY != 0) {
saveCanvas(danmaku, canvas, left, top);
needRestore = true;
}
int alpha = danmaku.getAlpha();
if (alpha != AlphaValue.MAX) {
alphaPaint = ALPHA_PAINT;
alphaPaint.setAlpha(danmaku.getAlpha());
}
}
// skip drawing when danmaku is transparent
if (alphaPaint != null && alphaPaint.getAlpha() == AlphaValue.TRANSPARENT) {
return IRenderer.NOTHING_RENDERING;
}
// drawing cache
boolean cacheDrawn = false;
int result = IRenderer.CACHE_RENDERING;
if (danmaku.hasDrawingCache()) {
DrawingCacheHolder holder = ((DrawingCache) danmaku.cache).get();
if (holder != null) {
cacheDrawn = holder.draw(canvas, left, top, alphaPaint);
}
}
if (!cacheDrawn) {
if (alphaPaint != null) {
PAINT.setAlpha(alphaPaint.getAlpha());
} else {
resetPaintAlpha(PAINT);
}
drawDanmaku(danmaku, canvas, left, top, true);
result = IRenderer.TEXT_RENDERING;
}
if (needRestore) {
restoreCanvas(canvas);
}
return result;
}
return IRenderer.NOTHING_RENDERING;
}
示例11: draw
@Override
public void draw(BaseDanmaku danmaku) {
float top = danmaku.getTop();
float left = danmaku.getLeft();
if (canvas != null) {
Paint alphaPaint = null;
boolean needRestore = false;
if (danmaku.getType() == BaseDanmaku.TYPE_SPECIAL) {
if (danmaku.getAlpha() == AlphaValue.TRANSPARENT) {
return;
}
if (danmaku.rotationZ != 0 || danmaku.rotationY != 0) {
saveCanvas(danmaku, canvas, left, top);
needRestore = true;
}
int alpha = danmaku.getAlpha();
if ( alpha != AlphaValue.MAX) {
alphaPaint = ALPHA_PAINT;
alphaPaint.setAlpha(danmaku.getAlpha());
}
}
// skip drawing when danmaku is transparent
if(alphaPaint!=null && alphaPaint.getAlpha()== AlphaValue.TRANSPARENT){
return;
}
// drawing cache
boolean cacheDrawn = false;
if (danmaku.hasDrawingCache()) {
DrawingCacheHolder holder = ((DrawingCache) danmaku.cache).get();
if (holder != null && holder.bitmap != null && !holder.bitmap.isRecycled()) {
canvas.drawBitmap(holder.bitmap, left, top, alphaPaint);
cacheDrawn = true;
}
}
if (!cacheDrawn) {
if (alphaPaint != null) {
PAINT.setAlpha(alphaPaint.getAlpha());
} else {
resetPaintAlpha(PAINT);
}
drawDanmaku(danmaku, canvas, left, top, true);
}
if (needRestore) {
restoreCanvas(canvas);
}
}
}